@@ -153,18 +153,23 @@ def test_template_source(self):
153153 response = self .client .get (url , data )
154154 self .assertEqual (response .status_code , 200 )
155155
156- def test_get_stats (self ):
156+ def test_get_stats_includes_editor_url (self ):
157157 response = self .panel .process_request (self .request )
158- Template ("" ).render (Context ({}))
159158 Template ("" , origin = Origin ("test.html" )).render (Context ({}))
160159 self .panel .generate_stats (self .request , response )
161160 stats = self .panel .get_stats ()
162- self .assertNotIn ("editor_url" , stats ["templates" ][0 ]["template" ])
163161 self .assertEqual (
164- stats ["templates" ][1 ]["template" ]["editor_url" ],
162+ stats ["templates" ][0 ]["template" ]["editor_url" ],
165163 "vscode://file/test.html:1" ,
166164 )
167165
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+
168173
169174@override_settings (
170175 DEBUG = True , DEBUG_TOOLBAR_PANELS = ["debug_toolbar.panels.templates.TemplatesPanel" ]
0 commit comments