'Test for determining image is deleted from cache when it is not found
in Glance Registry.'

def test_process_v1_request_for_deleted_but_cached_image(self):

    def fake_process_v1_request(request, image_id, image_iterator, image_meta):
        raise exception.ImageNotFound()
    def fake_get_v1_image_metadata(request, image_id):
        return {'status': 'active', 'properties': {}}
    image_id = 'test1'
    request = webob.Request.blank(('/v1/images/%s' % image_id))
    request.context = context.RequestContext()
    cache_filter = ProcessRequestTestCacheFilter()
    self.stubs.Set(cache_filter, '_get_v1_image_metadata', fake_get_v1_image_metadata)
    self.stubs.Set(cache_filter, '_process_v1_request', fake_process_v1_request)
    cache_filter.process_request(request)
    self.assertIn(image_id, cache_filter.cache.deleted_images)
