Skip to content

Commit aa45a06

Browse files
committed
Follow the new convention for Django 11.0
a new option --debug-mode has been introduced, so let's name ours --django-debug-mode
1 parent 18b147d commit aa45a06

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

docs/changelog.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Unreleased
77
Features
88
^^^^^^^^
99

10-
* Added a new option `--django-debug` to specify the default DEBUG setting (#228)
10+
* Added a new option `--django-debug-mode` to specify the default DEBUG setting (#228)
1111

1212
3.1.2
1313
-----

docs/configuring_django.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ But sometimes, especially for functional tests, you might want to avoid this, to
9292

9393
Command Line Option::
9494

95-
$ py.test --django-debug True|False|None
95+
$ py.test --django-debug-mode True|False|None
9696

9797
``None`` ensure there is no override of the test settings DEBUG value
9898
``True`` override DEBUG to True

pytest_django/plugin.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ def pytest_addoption(parser):
6868
group._addoption('--migrations',
6969
action='store_false', dest='nomigrations', default=False,
7070
help='Enable Django 1.7+ migrations on test setup')
71-
group._addoption('--django-debug',
72-
action='store', dest='djangodebug', default='False',
71+
group._addoption('--django-debug-mode',
72+
action='store', dest='djangodebugmode', default='False',
7373
help='Configure the DEBUG setting. Defaults to False')
7474
parser.addini(CONFIGURATION_ENV,
7575
'django-configurations class to use by pytest-django.')
@@ -340,8 +340,8 @@ def django_test_environment(request):
340340
from django.conf import settings as dj_settings
341341
from django.test.utils import (setup_test_environment,
342342
teardown_test_environment)
343-
if request.config.getvalue('djangodebug') != 'None':
344-
dj_settings.DEBUG = bool(strtobool(request.config.getvalue('djangodebug')))
343+
if request.config.getvalue('djangodebugmode') != 'None':
344+
dj_settings.DEBUG = bool(strtobool(request.config.getvalue('djangodebugmode')))
345345
setup_test_environment()
346346
request.addfinalizer(teardown_test_environment)
347347

tests/test_django_settings_module.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def test_debug_is_unchanged():
296296
assert settings.DEBUG is True
297297
""")
298298

299-
r = testdir.runpytest_subprocess('--django-debug=None')
299+
r = testdir.runpytest_subprocess('--django-debug-mode=None')
300300
assert r.ret == 0
301301

302302

@@ -321,7 +321,7 @@ def test_debug_is_false():
321321
assert settings.DEBUG is False
322322
""")
323323

324-
r = testdir.runpytest_subprocess('--django-debug=False')
324+
r = testdir.runpytest_subprocess('--django-debug-mode=False')
325325
assert r.ret == 0
326326

327327

@@ -346,7 +346,7 @@ def test_debug_is_true():
346346
assert settings.DEBUG is True
347347
""")
348348

349-
r = testdir.runpytest_subprocess('--django-debug=True')
349+
r = testdir.runpytest_subprocess('--django-debug-mode=True')
350350
assert r.ret == 0
351351

352352

0 commit comments

Comments
 (0)