cookiecutter-django/{{cookiecutter.project_slug}}/config/settings/test.py
Bruno Alla 4080e9a86d
Fix django-webpack-loader setup when running tests (#4128)
* Add an integration test

This should cover the problem raised for webpack loader issues

* Add a DummyWebpackLoader for running tests

* Replace DummyWebpackLoader by the one from webpack_loader package

* Fix post-gen hook

* Remove integration test
2023-02-06 16:16:48 +00:00

42 lines
1.4 KiB
Python

"""
With these settings, tests run faster.
"""
from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env(
"DJANGO_SECRET_KEY",
default="!!!SET DJANGO_SECRET_KEY!!!",
)
# https://docs.djangoproject.com/en/dev/ref/settings/#test-runner
TEST_RUNNER = "django.test.runner.DiscoverRunner"
# PASSWORDS
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#password-hashers
PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"]
# EMAIL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend"
# DEBUGGING FOR TEMPLATES
# ------------------------------------------------------------------------------
TEMPLATES[0]["OPTIONS"]["debug"] = True # type: ignore # noqa F405
{%- if cookiecutter.frontend_pipeline == 'Webpack' %}
# django-webpack-loader
# ------------------------------------------------------------------------------
WEBPACK_LOADER["DEFAULT"][ # noqa F405
"LOADER_CLASS"
] = "webpack_loader.loader.FakeWebpackLoader"
{%- endif %}
# Your stuff...
# ------------------------------------------------------------------------------