Opened 8 years ago

Last modified 8 years ago

#27012 closed Bug

test_nested_requests wipes out pre-test settings — at Initial Version

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

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 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()).

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top