#31897: Example in `Using settings in Python code` documentation is misleading
-------------------------------------+-------------------------------------
Reporter: Garrett | Owner: nobody
Edel |
Type: | Status: new
Cleanup/optimization |
Component: | Version: 3.1
Documentation | Keywords:
Severity: Normal | settings,documentation
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
The current example (https://docs.djangoproject.com/en/3.1/topics/settings
/#using-settings-in-python-code) for how to use from `django.conf import
settings` includes the example of using `settings.DEBUG`.
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.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/050.8ccd448ae1849b3b8e732fb349bafd84%40djangoproject.com.