From f02aa463a7eeb66fb8d22d744f40e962b51e7ef9 Mon Sep 17 00:00:00 2001 From: Dani Hodovic Date: Mon, 8 Jul 2019 14:14:59 +0800 Subject: [PATCH] Always use test settings in pytest You can alternatively use DJANGO_SETTINGS_MODULE, but this is overridden by the environment variable of the same name. In order to always run it with test settings, regardless of the environment variable use --ds. https://pytest-django.readthedocs.io/en/latest/configuring_django.html --- {{cookiecutter.project_slug}}/pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/pytest.ini b/{{cookiecutter.project_slug}}/pytest.ini index 690c78f10..9fb488cbc 100644 --- a/{{cookiecutter.project_slug}}/pytest.ini +++ b/{{cookiecutter.project_slug}}/pytest.ini @@ -1,5 +1,5 @@ [pytest] -DJANGO_SETTINGS_MODULE=config.settings.test +addopts = --ds=config.settings.test {%- if cookiecutter.js_task_runner != 'None' %} norecursedirs = node_modules {%- endif %}