def enable(self):
# Just patch default cache to always find nothing
# since drf-extensions stores the instance of the cache everywhere,
# which makes it impossible to replace with DummyCache
def mocked_cache_get(key, default=None, version=None):
return default
self.patch = patch.object(cache_module.cache, 'get', mocked_cache_get)
self.patch.start()
评论列表
文章目录