Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#8401 closed (fixed)

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

Reported by: rishi Owned by: nobody
Component: Documentation Version: dev
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: no UI/UX: no

Description

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:
source:/django/trunk/django/test/simple.py#L123

Change History (5)

comment:1 by Russell Keith-Magee, 16 years ago

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 by Eric Holscher, 16 years ago

Component: Unit test systemDocumentation
milestone: 1.0
Summary: Default TEST_RUNNER - 'django.test.simple.run_tests' - forces settings.DEBUG = FalseDocument : 'django.test.simple.run_tests' - forces settings.DEBUG = False
Triage Stage: UnreviewedAccepted

comment:3 by Malcolm Tredinnick, 16 years ago

milestone: 1.0post-1.0

comment:4 by Russell Keith-Magee, 16 years ago

Resolution: fixed
Status: newclosed

(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 by (none), 16 years ago

milestone: post-1.0

Milestone post-1.0 deleted

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