Coverage for config/settings/test.py: 100%

15 statements  

« prev     ^ index     » next       coverage.py v7.10.7, created at 2026-10-06 13:07 +0000

1"""Settings for the test suite: fast hashing, in-memory email and cache.""" 

2 

3from .base import * # noqa: F403 

4from .base import TEMPLATES 

5from .base import env 

6 

7SECRET_KEY = env("DJANGO_SECRET_KEY", default="test-only-not-secret") 

8ALLOWED_HOSTS = ["testserver", "localhost"] 

9TEST_RUNNER = "django.test.runner.DiscoverRunner" 

10PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"] 

11EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend" 

12CACHES = {"default": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache", "LOCATION": ""}} 

13CELERY_TASK_ALWAYS_EAGER = True 

14CELERY_TASK_EAGER_PROPAGATES = True 

15STORAGES = { 

16 "default": {"BACKEND": "django.core.files.storage.InMemoryStorage"}, 

17 "private": {"BACKEND": "django.core.files.storage.InMemoryStorage"}, 

18 "staticfiles": {"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage"}, 

19} 

20TEMPLATES[0]["OPTIONS"]["debug"] = True # type: ignore[index] 

21MESSAGING_PROVIDER = "baibu.users.messaging.MemoryMessagingProvider" 

22 

23# Tests of the translation workflow turn this on; other tests should not 

24# query for publications on every request. 

25LOCALIZATION_SYNC = False