Opened 9 years ago
Last modified 9 years ago
#27012 closed Bug
test_nested_requests wipes out pre-test settings — at Version 1
| Reported by: | Chris Jerdonek | Owned by: | nobody |
|---|---|---|---|
| Component: | Testing framework | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
I noticed that nested_view() calls setup_test_environment() (direct link):
def nested_view(request): setup_test_environment() c = Client() c.get("/no_template_view/") return render(request, 'base.html', {'nested': 'yes'})
This function is used in the test: test_client_regress.tests.ContextTests.test_nested_requests.
This causes pre-test setting values like _original_email_backend and _original_allowed_hosts to be wiped out because these values are overwritten by the test values when setup_test_environment() is called a second time (see here for setup_test_environment()).
Note:
See TracTickets
for help on using tickets.