'Posting answer attaches an existing uploaded image to the answer.'

def test_answer_upload(self):

    f = open('kitsune/upload/tests/media/test.jpg')
    post(self.client, 'upload.up_image_async', {'image': f}, args=['auth.User', self.user.pk])
    f.close()
    content = 'lorem    ipsum    dolor    sit    amet'
    response = post(self.client, 'questions.reply', {'content': content}, args=[self.question.id])
    eq_(200, response.status_code)
    new_answer = self.question.answers.order_by('-id')[0]
    eq_(1, new_answer.images.count())
    image = new_answer.images.all()[0]
    name = '098f6b.png'
    message = ('File    name    "%s"    does    not    contain    "%s"' % (image.file.name, name))
    assert (name in image.file.name), message
    eq_(self.user.username, image.creator.username)
    ImageAttachment.objects.all().delete()
