This repository was archived by the owner on Feb 5, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 157
Expand file tree
/
Copy pathtest_settings.py
More file actions
65 lines (53 loc) · 1.32 KB
/
test_settings.py
File metadata and controls
65 lines (53 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Test settings for FasterRunner
import datetime
from FasterRunner.settings.base import *
# Test database configuration
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
# Disable external services for testing
CELERY_TASK_ALWAYS_EAGER = True
CELERY_TASK_EAGER_PROPAGATES = True
# Use in-memory cache for tests
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
}
}
# Test logging
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'console': {
'class': 'logging.StreamHandler',
},
},
'root': {
'handlers': ['console'],
'level': 'WARNING',
},
}
# Security settings for tests
SECRET_KEY = 'django-insecure-test-key-not-for-production-use-only'
DEBUG = False
ALLOWED_HOSTS = ['*']
# Disable external integrations
USE_LDAP = False
# Test JWT settings
JWT_AUTH = {
'JWT_EXPIRATION_DELTA': datetime.timedelta(seconds=300),
'JWT_AUTH_HEADER_PREFIX': 'Token',
}
# Disable migration running in tests
class DisableMigrations:
def __contains__(self, item):
return True
def __getitem__(self, item):
return None
MIGRATION_MODULES = DisableMigrations()
# Test settings
TEST_RUNNER = 'django.test.runner.DiscoverRunner'