'Tests update members of deleted image raises 404.'

def test_update_members_of_deleted_image_raises_404(self):

    test_router = router.API(self.mapper)
    self.api = test_utils.FakeAuthMiddleware(test_router, is_admin=True)
    req = webob.Request.blank(('/images/%s/members/pattieblack' % UUID2))
    req.method = 'PUT'
    res = req.get_response(self.api)
    self.assertEqual(http_client.NO_CONTENT, res.status_int)
    req = webob.Request.blank(('/images/%s' % UUID2))
    req.method = 'DELETE'
    res = req.get_response(self.api)
    self.assertEqual(http_client.OK, res.status_int)
    fixture = [{'member_id': 'pattieblack', 'can_share': 'false'}]
    req = webob.Request.blank(('/images/%s/members' % UUID2))
    req.method = 'PUT'
    req.content_type = 'application/json'
    req.body = jsonutils.dump_as_bytes(dict(memberships=fixture))
    res = req.get_response(self.api)
    self.assertEqual(webob.exc.HTTPNotFound.code, res.status_int)
    body = res.body.decode('utf-8')
    self.assertIn(('Image    with    identifier    %s    has    been    deleted.' % UUID2), body)
