diff --git a/lacommunaute/conftest.py b/lacommunaute/conftest.py new file mode 100644 index 00000000..0bfa2d3b --- /dev/null +++ b/lacommunaute/conftest.py @@ -0,0 +1,8 @@ +import pytest +from django.core.management import call_command + + +@pytest.fixture(scope="session", autouse=True) +def run_compress(django_db_setup, django_db_blocker): + with django_db_blocker.unblock(): + call_command("compress", "--force") diff --git a/pytest.ini b/pytest.ini index 264c006d..fa1199b2 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,5 +1,5 @@ [pytest] -DJANGO_SETTINGS_MODULE = config.settings.dev +DJANGO_SETTINGS_MODULE = config.settings.base python_files = tests*.py test_*.py addopts = --reuse-db