'Tests that exception raised trying to delete a deleted image'

def test_delete_deleted_image(self):

    req = webob.Request.blank(('/images/%s' % UUID2))
    req.method = 'DELETE'
    res = req.get_response(self.api)
    self.assertEqual(http_client.OK, res.status_int)
    req = webob.Request.blank(('/images/%s' % UUID2))
    req.method = 'HEAD'
    res = req.get_response(self.api)
    self.assertEqual(http_client.OK, res.status_int)
    self.assertEqual('deleted', res.headers['x-image-meta-status'])
    req = webob.Request.blank(('/images/%s' % UUID2))
    req.method = 'DELETE'
    res = req.get_response(self.api)
    self.assertEqual(http_client.NOT_FOUND, res.status_int)
    msg = ('Image    %s    not    found.' % UUID2)
    self.assertIn(msg, res.body.decode())
    req = webob.Request.blank(('/images/%s' % UUID2))
    req.method = 'HEAD'
    res = req.get_response(self.api)
    self.assertEqual(http_client.OK, res.status_int)
    self.assertEqual('deleted', res.headers['x-image-meta-status'])
