Skip to content

Commit 65a2525

Browse files
committed
Let django's setup/teardown set DEBUG for us
It properly restores it as well.
1 parent c0d10af commit 65a2525

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pytest_django/plugin.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,11 +445,9 @@ def django_test_environment(request):
445445
"""
446446
if django_settings_is_configured():
447447
_setup_django()
448-
from django.conf import settings as dj_settings
449448
from django.test.utils import setup_test_environment, teardown_test_environment
450449

451-
dj_settings.DEBUG = False
452-
setup_test_environment()
450+
setup_test_environment(debug=False)
453451
request.addfinalizer(teardown_test_environment)
454452

455453

0 commit comments

Comments
 (0)