325e787e13e8dd4b389e804c3f1b7a86a0f9d58a,tests/tests.py,DebugToolbarTestCase,test_request_urlconf_module,#DebugToolbarTestCase#,96
Before Change
request.urlconf = __import__("tests.urls").urls
middleware = DebugToolbarMiddleware()
with self.settings(INTERNAL_IPS=["127.0.0.1"], DEBUG=True):
middleware.process_request(request)
self.assertFalse(isinstance(request.urlconf, six.string_types))
patterns = request.urlconf.urlpatterns
self.assertTrue(hasattr(patterns[1], "_callback_str"))
self.assertEqual(patterns[-1]._callback_str, "tests.views.execute_sql")
def test_tuple_urlconf(self):
request = rf.get("/")
urls = __import__("tests.urls").urls
urls.urlpatterns = tuple(urls.urlpatterns)
After Change
request.urlconf = __import__("tests.urls").urls
middleware = DebugToolbarMiddleware()
middleware.process_request(request)
self.assertFalse(isinstance(request.urlconf, six.string_types))
patterns = request.urlconf.urlpatterns
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 5
Instances
Project Name: jazzband/django-debug-toolbar
Commit Name: 325e787e13e8dd4b389e804c3f1b7a86a0f9d58a
Time: 2013-11-01
Author: aymeric.augustin@m4x.org
File Name: tests/tests.py
Class Name: DebugToolbarTestCase
Method Name: test_request_urlconf_module
Project Name: jazzband/django-debug-toolbar
Commit Name: 325e787e13e8dd4b389e804c3f1b7a86a0f9d58a
Time: 2013-11-01
Author: aymeric.augustin@m4x.org
File Name: tests/tests.py
Class Name: DebugToolbarTestCase
Method Name: test_request_urlconf_string_per_request
Project Name: jazzband/django-debug-toolbar
Commit Name: 325e787e13e8dd4b389e804c3f1b7a86a0f9d58a
Time: 2013-11-01
Author: aymeric.augustin@m4x.org
File Name: tests/tests.py
Class Name: DebugToolbarTestCase
Method Name: test_request_urlconf_string
Project Name: jazzband/django-debug-toolbar
Commit Name: 325e787e13e8dd4b389e804c3f1b7a86a0f9d58a
Time: 2013-11-01
Author: aymeric.augustin@m4x.org
File Name: tests/tests.py
Class Name: DebugToolbarTestCase
Method Name: test_tuple_urlconf