@@ -153,18 +153,23 @@ def test_template_source(self):
153
153
response = self .client .get (url , data )
154
154
self .assertEqual (response .status_code , 200 )
155
155
156
- def test_get_stats (self ):
156
+ def test_get_stats_includes_editor_url (self ):
157
157
response = self .panel .process_request (self .request )
158
- Template ("" ).render (Context ({}))
159
158
Template ("" , origin = Origin ("test.html" )).render (Context ({}))
160
159
self .panel .generate_stats (self .request , response )
161
160
stats = self .panel .get_stats ()
162
- self .assertNotIn ("editor_url" , stats ["templates" ][0 ]["template" ])
163
161
self .assertEqual (
164
- stats ["templates" ][1 ]["template" ]["editor_url" ],
162
+ stats ["templates" ][0 ]["template" ]["editor_url" ],
165
163
"vscode://file/test.html:1" ,
166
164
)
167
165
166
+ def test_get_stats_excludes_editor_url (self ):
167
+ response = self .panel .process_request (self .request )
168
+ Template ("" ).render (Context ({}))
169
+ self .panel .generate_stats (self .request , response )
170
+ stats = self .panel .get_stats ()
171
+ self .assertNotIn ("editor_url" , stats ["templates" ][0 ]["template" ])
172
+
168
173
169
174
@override_settings (
170
175
DEBUG = True , DEBUG_TOOLBAR_PANELS = ["debug_toolbar.panels.templates.TemplatesPanel" ]
0 commit comments