import tempfile from pathlib import Path from .base import * # noqa: F403 SECRET_KEY = "test-secret-key" # Keep every test artifact out of the repo tree. MEDIA_ROOT = Path(tempfile.mkdtemp(prefix="infrasynth-test-media-")) DATABASES = { "default": { "ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:", }, } PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"] CELERY_TASK_ALWAYS_EAGER = True CELERY_TASK_EAGER_PROPAGATES = True CACHES = { "default": { "BACKEND": "django.core.cache.backends.locmem.LocMemCache", }, } INFRASYNTH_SECURITY["CRYPTO_KEY"] = "sBptcnWgrG5Tp8MJCnSoGQzZLb_4QPwNjuM4QNTGWe4=" INFRASYNTH_SECURITY["COOKIE_SECURE"] = False INFRASYNTH_AUDIT["STORE_IN_DB"] = True # Tests default to the pre-envelope wire format so the bulk of the suite asserts # on raw payloads; tests/test_api enables the envelope/cursor layer explicitly. REST_FRAMEWORK = { "DEFAULT_AUTHENTICATION_CLASSES": [ "infrasynth.security.auth.cookies.CookieJWTAuthentication", "infrasynth.security.auth.api_keys.APIKeyAuthentication", ], "DEFAULT_PERMISSION_CLASSES": [ "rest_framework.permissions.IsAuthenticated", "infrasynth.security.permissions.AutoPermission", ], "DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.PageNumberPagination", "PAGE_SIZE": 25, "DEFAULT_FILTER_BACKENDS": ["django_filters.rest_framework.DjangoFilterBackend"], } # The tenant middleware is exercised by dedicated tests via override_settings. INFRASYNTH_TENANCY["ENABLED"] = False INFRASYNTH_TENANCY["REQUIRE_TENANT_BY_DEFAULT"] = False