def clear_all_caches(): """Clear all caches so that cache info doesn't leak across test cases.""" # This will no longer be necessary when Django adds (in Django 1.10?): # https://code.djangoproject.com/ticket/11505 for cache in django.core.cache.caches.all(): cache.clear() RequestCache().clear_request_cache()
def cache_clear(): """Clear the cache and cache statistics. This only affects the instance cache and dose not impact data stored in l2 Cache""" with lock: cache.clear() root = nonlocal_root[0] root[:] = [root, root, None, None] stats[:] = [0, 0, 0, 0]