Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#8401 closed (fixed)

Document : 'django.test.simple.run_tests' - forces settings.DEBUG = False

Reported by: rishi Owned by: nobody
Component: Documentation Version: master
Severity: Keywords: TEST_RUNNER DEBUG test
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


There doesn't seem to be a documented reason for forcing the settings.DEBUG value to False. The TEST_RUNNER should just use the value specified in the --settings option of the test management command. If there is a good reason to force the setting, it should be doc'd.

Commenting out this line and running this test w/ settings.DEBUG = True seems to work.

Here is the code:

Change History (5)

comment:1 Changed 8 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

There are at least 2 very good reasons for forcing settings DEBUG=False during tests. One is philosophical - your live site should be running with Debug=False, and test conditions should be matching your live site. The second reason is practial - there are some aspects of Django (most notably the handling of errors in templates, but there are others) which can have an effect on the output of tests.

If this isn't documented in the user docs, it should be. Documentation changes are momentarily on hold until the documentation refactor lands in a couple of days, but I'll look into this more when the refactor lands.

comment:2 Changed 8 years ago by ericholscher

  • Component changed from Unit test system to Documentation
  • milestone set to 1.0
  • Summary changed from Default TEST_RUNNER - 'django.test.simple.run_tests' - forces settings.DEBUG = False to Document : 'django.test.simple.run_tests' - forces settings.DEBUG = False
  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 8 years ago by mtredinnick

  • milestone changed from 1.0 to post-1.0

comment:4 Changed 8 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(In [8514]) Fixed #8401: Added a note on the fact that DEBUG=False is forced during test execution. Thanks to rishi for the suggestion.

comment:5 Changed 7 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top