#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):

 Well, I am not relying on `os.environ`, but want to test what the app /
 Django makes out of it.
 This is a bit like assuming that `settings` is being used in the tests
 (apart from special cases like `settings.DEBUG`).

 My example should make it clear: I do not want to mock anything, but see
 what gets rendered from what's provided.

 Knowing the internals of the test client I could manually extend
 `request.META`, but then it's still not certain that it would be the same
 as with a real environment.

 I really think that the test client should provide the environment similar
 to runserver / the wsgi adapter.

 I am a bit uncertain here how the test client and live server
 interact/behave in this regard.

 Is this maybe more a case of using the live server (LiveServerTestCase) to
 test against?
 Does the live server setup the environment with `os.environ` like
 `runserver`, or is it like with the test client?

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

Reply via email to