#23006: test.Client: provide os.environ with request.meta for consistency
-----------------------------------+--------------------------------------
     Reporter:  blueyed            |                    Owner:  nobody
         Type:  Bug                |                   Status:  new
    Component:  Testing framework  |                  Version:  master
     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 blueyed):

 > I'm a bit skeptical of your use case. There's a fair chance that
 DJANGO_SECRET_KEY will exist in prod even if it doesn't exist in test.
 This sounds unsafe.

 I set `SECRET_KEY` via the environment only (based on django-
 configurations and envdir).

 I know that a certain/different envdir on prod vs. dev has an impact, and
 that's why I would like to be certain that the test client uses the same
 metrics as the wsgi adapter.


 This issue evolved out of the need that I wanted to test how Django
 renders its exception template based on the user/environment.

 Please note that this involves mocking/setting `client.store_exc_info` to
 make the exception's template content available for the test.

 Ref: https://github.com/pelme/pytest_django/issues/130 - see the test in
 https://github.com/pelme/pytest_django/issues/130#issuecomment-48771382.
 This is the basic foundation for other tests in this regard.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/23006#comment:4>
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/065.f5893ca8a1353e1ad2b3d7b604ab2595%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to