27 lines
944 B
Python
27 lines
944 B
Python
|
|
"""Test settings: fast, hermetic, no external services required."""
|
||
|
|
|
||
|
|
import os
|
||
|
|
|
||
|
|
os.environ.setdefault("DJANGO_SECRET_KEY", "test-secret-key-not-used-anywhere-else")
|
||
|
|
os.environ.setdefault("DATABASE_URL", "postgres://postgres:postgres@localhost:5432/test_db")
|
||
|
|
|
||
|
|
from .base import * # noqa: E402, F403
|
||
|
|
from .base import LOGGING, SEARCH # noqa: E402
|
||
|
|
|
||
|
|
DEBUG = False
|
||
|
|
SEARCH["BACKEND"] = "postgres" # tests must not need a live Elasticsearch
|
||
|
|
|
||
|
|
# Cheap password hashing keeps the suite quick.
|
||
|
|
PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"] # noqa: S105
|
||
|
|
|
||
|
|
CACHES = {"default": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"}}
|
||
|
|
|
||
|
|
# Throttling off by default; individual tests enable it explicitly.
|
||
|
|
REST_FRAMEWORK_THROTTLE_DISABLED = True
|
||
|
|
|
||
|
|
EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend"
|
||
|
|
|
||
|
|
LOGGING["root"]["level"] = "CRITICAL"
|
||
|
|
for _logger in LOGGING["loggers"].values():
|
||
|
|
_logger["level"] = "CRITICAL"
|