tests: clear event type cache between tests

This commit is contained in:
Benjamin Dauvergne 2020-10-23 10:22:30 +02:00
parent 05ef7c9e3d
commit be21781e45
1 changed files with 7 additions and 0 deletions

View File

@ -25,3 +25,10 @@ def app(request, db, settings, tmpdir):
request.addfinalizer(wtm._unpatch_settings)
settings.MEDIA_DIR = str(tmpdir.mkdir('media'))
return django_webtest.DjangoTestApp(extra_environ={'HTTP_HOST': 'localhost'})
@pytest.fixture(autouse=True)
def clear_event_type_cache(db):
from authentic2.apps.journal.models import event_type_cache
yield
event_type_cache.cache.clear()