Opened 10 years ago
Last modified 10 years ago
#24722 closed Bug
test client puts different results in response.context when nested view is redirected with process_request vs process_response middleware — at Version 1
Reported by: | Jay Cox | Owned by: | nobody |
---|---|---|---|
Component: | Testing framework | Version: | dev |
Severity: | Normal | Keywords: | test client |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
When using the test client:
When a view calls another view and middleware causes the inner view to redirect - the contents of response.context will be different depending on if it was process_request, or process_response that initiated the redirect.
Test case for this error is in gitub:
https://github.com/electricjay/django/tree/test_client_nested_testcase
This problem was discovered when creating the pull request https://github.com/django/django/pull/4574 for ticket #24696