#30605: Define a variable TESTS in settings
-------------------------------+--------------------------------------
     Reporter:  אורי           |                    Owner:  nobody
         Type:  New feature    |                   Status:  new
    Component:  Uncategorized  |                  Version:
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------

Comment (by Josh Smeaton):

 How I've traditionally handled this is to define a completely new settings
 module: tests.py.

 It inherits all values from the production settings module, and then
 overrides everything else it needs to.

 Django forcing a setting based on the context it is running in isn't such
 a good idea - especially since it'd have to do so **after** the settings
 have already been loaded.

 Steps:

 1. Run a management command called "test"
 2. Run django.setup()
 3. Settings are configured
 4. The test command is run

 It's already "too late" at this stage to set a global setting.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30605#comment:2>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.fa2ddb1d1ad894e30d135c1192bec303%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to