The example is fine, but if a user tries to replicate this in their test
scripts `settings.DEBUG` will always return `False` as intended in the
design of Django tests
(https://docs.djangoproject.com/en/3.1/topics/testing/overview/#other-
test-conditions). This PR simply adds an admonition in the docs to warn
users about this and offer an alternative with override_settings().
PR here: https://github.com/django/django/pull/13308
--
Ticket URL: <https://code.djangoproject.com/ticket/31897>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => invalid
Comment:
Thanks for this ticket, however I don't see anything misleading in these
examples. IMO we shouldn't mix an example of using settings in Python code
(which is not a `DEBUG` docs) with a design decision about running tests
with `DEBUG =False`, it is beyond the scope of this paragraph.
--
Ticket URL: <https://code.djangoproject.com/ticket/31897#comment:1>