'If an avatar is missing, allow replacing it.'

def test_replace_missing_avatar(self):

    assert (not self.profile.avatar), 'User    has    no    avatar.'
    self.profile.avatar = 'path/does/not/exist.jpg'
    self.profile.save()
    assert self.profile.avatar, 'User    has    a    bad    avatar.'
    with open('kitsune/upload/tests/media/test.jpg') as f:
        url = reverse('users.edit_avatar', locale='en-US')
        data = {'avatar': f}
        r = self.client.post(url, data)
    eq_(302, r.status_code)
    p = Profile.objects.get(user=self.user)
    assert p.avatar, 'User    has    an    avatar.'
    assert (not p.avatar.path.endswith('exist.jpg'))
    assert p.avatar.path.endswith('.png')
