Opened 10 years ago

Closed 10 years ago

#22572 closed Bug (fixed)

@override_settings(ROOT_URLCONF) doesn't clear urlresolvers._urlconfs.

Reported by: loic84 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

BaseHandler.get_response() sets urlresolvers._urlconfs through the set_urlconf() function; this normally happens for every request.

The test client calls get_response(), but since @override_settings(ROOT_URLCONF) doesn't clear it, further reverse outside of the test client may fail.

This only affects single tests with multiple override_settings because SimpleTestCase clears the urlconf between tests.

Change History (4)

comment:2 by ANUBHAV JOSHI, 10 years ago

I think the issue being raised is valid and the PR opened is good to go.

comment:3 by Tim Graham, 10 years ago

Triage Stage: UnreviewedReady for checkin

comment:4 by Loic Bistuer <loic.bistuer@…>, 10 years ago

Resolution: fixed
Status: newclosed

In 942556df2ffd3276dc127edd3cbb9d177095d882:

Fixed #22572 -- override_settings(ROOT_URLCONF) didn't clear urlresolvers._urlconfs.

Thanks Anubhav Joshi and Tim Graham for the reviews.

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