@pytest.fixture
def clear_cache():
 from django.core.cache import caches
 from django_redis import get_redis_connection
 get_redis_connection('default').flushdb()
 caches['exports'].clear()

@ pytest . fixture def clear_cache ( ) : from django . core . cache import caches from django_redis import get_redis_connection get_redis_connection ( 'default' ) . flushdb ( ) caches [ 'exports' ] . clear ( )
completely clear hgfs cache .