[Django] #22572: @override_settings(ROOT_URLCONF) doesn't clear urlresolvers._urlconfs.

34 views
Skip to first unread message

Django

unread,
May 4, 2014, 11:59:32 AM5/4/14
to django-...@googlegroups.com
#22572: @override_settings(ROOT_URLCONF) doesn't clear urlresolvers._urlconfs.
-----------------------------------+--------------------
Reporter: loic84 | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------
`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.

--
Ticket URL: <https://code.djangoproject.com/ticket/22572>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 4, 2014, 12:01:49 PM5/4/14
to django-...@googlegroups.com
#22572: @override_settings(ROOT_URLCONF) doesn't clear urlresolvers._urlconfs.
-----------------------------------+--------------------------------------

Reporter: loic84 | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by loic84):

* needs_docs: => 0
* has_patch: 0 => 1
* needs_tests: => 0
* needs_better_patch: => 0


Comment:

PR https://github.com/django/django/pull/2631.

--
Ticket URL: <https://code.djangoproject.com/ticket/22572#comment:1>

Django

unread,
May 4, 2014, 1:46:21 PM5/4/14
to django-...@googlegroups.com
#22572: @override_settings(ROOT_URLCONF) doesn't clear urlresolvers._urlconfs.
-----------------------------------+--------------------------------------

Reporter: loic84 | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------

Comment (by anubhav9042):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/22572#comment:2>

Django

unread,
May 5, 2014, 6:53:01 AM5/5/14
to django-...@googlegroups.com
#22572: @override_settings(ROOT_URLCONF) doesn't clear urlresolvers._urlconfs.
-------------------------------------+-------------------------------------

Reporter: loic84 | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
Has patch: 1 | checkin
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timo):

* stage: Unreviewed => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/22572#comment:3>

Django

unread,
May 5, 2014, 8:50:57 AM5/5/14
to django-...@googlegroups.com
#22572: @override_settings(ROOT_URLCONF) doesn't clear urlresolvers._urlconfs.
-------------------------------------+-------------------------------------
Reporter: loic84 | Owner: nobody
Type: Bug | Status: closed

Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
Has patch: 1 | checkin
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Loic Bistuer <loic.bistuer@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"942556df2ffd3276dc127edd3cbb9d177095d882"]:
{{{
#!CommitTicketReference repository=""
revision="942556df2ffd3276dc127edd3cbb9d177095d882"
Fixed #22572 -- override_settings(ROOT_URLCONF) didn't clear
urlresolvers._urlconfs.

Thanks Anubhav Joshi and Tim Graham for the reviews.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22572#comment:4>

Reply all
Reply to author
Forward
0 new messages