'Users with permission can delete images.'

def test_delete_image_with_permission(self):

    ct = ContentType.objects.get_for_model(ImageAttachment)
    p = Permission.objects.get_or_create(codename='delete_imageattachment', content_type=ct)[0]
    self.user.user_permissions.add(p)
    assert self.user.has_perm('upload.delete_imageattachment')
    self.test_upload_image()
    im = ImageAttachment.objects.all()[0]
    r = self._make_post_request(args=[im.id])
    eq_(200, r.status_code)
    json_r = json.loads(r.content)
    eq_('success', json_r['status'])
    assert (not ImageAttachment.objects.exists())
