#24722: test client puts different results in response.context when nested view
is
redirected with process_request vs process_response middleware
-----------------------------------+------------------------------------
Reporter: electricjay | Owner: nobody
Type: Bug | Status: closed
Component: Testing framework | Version: master
Severity: Normal | Resolution: invalid
Keywords: test client | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by electricjay):
* status: new => closed
* resolution: => invalid
Comment:
I have tracked the cause down and I no longer think this is a bug with the
test client.
When the redirect happens in **process_response** a 404 response is
created using a template before **process_response** is run. Thus the
test client is legitimately(?) adding the context from the 404 response to
the context of the response that is ultimately returned.
I suggest only modifying the test
test_client_regress.tests.ContextTests.test_nested_requests to not trigger
the ''common middleware''.
--
Ticket URL: <https://code.djangoproject.com/ticket/24722#comment:3>
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.cc73ffe7ae49ac9c33f4ccca113f1298%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.