HH/conftest.py
ismail 17064fc33c fix(inquiry): dept_manager of handling dept can now record department response
The inquiry_department_response view excluded dept managers even though
they can resolve the inquiry via inquiry_change_status. Now both actions
use the same handling_department_id predicate so forwarding locks the
old department out consistently.
2026-07-20 21:46:04 +03:00

31 lines
1.2 KiB
Python

"""Project-wide pytest fixtures.
The default test environment runs without a collected staticfiles manifest
(``addopts = "--reuse-db --nomigrations"`` in pyproject.toml), so any view
that renders a template containing ``{% static %}`` tags against
``CompressedManifestStaticFilesStorage`` raises ``ValueError: Missing
staticfiles manifest entry for ...``.
This autouse fixture swaps in plain ``StaticFilesStorage`` for the duration
of every test, so tests can assert ``status_code == 200`` on template-rendering
views without first running ``collectstatic``.
"""
import pytest
from django.test import override_settings
from config.settings.base import STORAGES as BASE_STORAGES
@pytest.fixture(autouse=True)
def _disable_static_manifest():
"""Use plain StaticFilesStorage (no manifest hashing) during tests."""
staticfiles_storage = {
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
}
storages_override = {**BASE_STORAGES, "staticfiles": staticfiles_storage}
with override_settings(
STATICFILES_STORAGE="django.contrib.staticfiles.storage.StaticFilesStorage",
STORAGES=storages_override,
):
yield