Skip to content

Commit a4960f3

Browse files
committed
Add specific test settings
1 parent aa9c078 commit a4960f3

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

config/django/test.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from .base import * # noqa
2+
3+
# Based on https://www.hacksoft.io/blog/optimize-django-build-to-run-faster-on-github-actions
4+
5+
DEBUG = False
6+
PASSWORD_HASHERS = ['django.contrib.auth.hashers.MD5PasswordHasher']
7+
8+
CELERY_BROKER_BACKEND = "memory"
9+
CELERY_TASK_ALWAYS_EAGER = True
10+
CELERY_TASK_EAGER_PROPAGATES = True
11+
12+
CACHES = {
13+
"default": {
14+
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
15+
}
16+
}

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -- FILE: pytest.ini (or tox.ini)
22
[pytest]
3-
DJANGO_SETTINGS_MODULE = config.django.base
3+
DJANGO_SETTINGS_MODULE = config.django.test
44
# -- recommended but optional:
55
python_files = tests.py test_*.py *_tests.py

0 commit comments

Comments
 (0)