File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,17 @@ def test_is_toolbar_request_without_djdt_urls(self):
121121 self .request .path = "/render_panel/"
122122 self .assertFalse (self .toolbar .is_toolbar_request (self .request ))
123123
124+ @override_settings (ROOT_URLCONF = "tests.urls_invalid" )
125+ def test_is_toolbar_request_override_request_urlconf (self ):
126+ """Test cases when the toolbar URL is configured on the request."""
127+ self .request .path = "/__debug__/render_panel/"
128+ self .assertFalse (self .toolbar .is_toolbar_request (self .request ))
129+
130+ # Verify overriding the urlconf on the request is valid.
131+ self .request .urlconf = "tests.urls"
132+ self .request .path = "/__debug__/render_panel/"
133+ self .assertTrue (self .toolbar .is_toolbar_request (self .request ))
134+
124135
125136@override_settings (DEBUG = True )
126137class DebugToolbarIntegrationTestCase (IntegrationTestCase ):
You can’t perform that action at this time.
0 commit comments