325e787e13e8dd4b389e804c3f1b7a86a0f9d58a,tests/tests.py,DebugToolbarTestCase,test_request_urlconf_string,#DebugToolbarTestCase#,66

Before Change


        request.urlconf = "tests.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_request_urlconf_string_per_request(self):
        request = rf.get("/")
        request.urlconf = "debug_toolbar.urls"
        middleware = DebugToolbarMiddleware()

After Change


        request.urlconf = "tests.urls"
        middleware = DebugToolbarMiddleware()

        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_request_urlconf_string_per_request(self):
        request = rf.get("/")
        request.urlconf = "debug_toolbar.urls"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

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_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_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