'Uploading an image works.'

def test_upload_image(self):

    with open('kitsune/upload/tests/media/test.jpg') as f:
        r = self._make_post_request(image=f)
    eq_(200, r.status_code)
    json_r = json.loads(r.content)
    eq_('success', json_r['status'])
    file = json_r['file']
    eq_('test.png', file['name'])
    eq_(90, file['width'])
    eq_(120, file['height'])
    name = '098f6b.png'
    message = ('Url    "%s"    does    not    contain    "%s"' % (file['url'], name))
    assert (name in file['url']), message
    eq_(1, ImageAttachment.objects.count())
    image = ImageAttachment.objects.all()[0]
    eq_(self.user.username, image.creator.username)
    eq_(150, image.file.width)
    eq_(200, image.file.height)
    eq_('question', image.content_type.model)
