@@ -321,11 +321,44 @@ def test_sql_profile_checks_show_toolbar(self):
321
321
self .assertEqual (response .status_code , 404 )
322
322
323
323
@override_settings (DEBUG_TOOLBAR_CONFIG = {"RENDER_PANELS" : True })
324
- def test_data_store_id_not_rendered_when_none (self ):
324
+ def test_render_panels_in_request (self ):
325
+ """
326
+ Test that panels are are rendered during the request with
327
+ RENDER_PANELS=TRUE
328
+ """
325
329
url = "/regular/basic/"
326
330
response = self .client .get (url )
327
331
self .assertIn (b'id="djDebug"' , response .content )
332
+ # Verify the store id is not included.
328
333
self .assertNotIn (b"data-store-id" , response .content )
334
+ # Verify the history panel was disabled
335
+ self .assertIn (
336
+ b'<input type="checkbox" data-cookie="djdtHistoryPanel" '
337
+ b'title="Enable for next and successive requests">' ,
338
+ response .content ,
339
+ )
340
+ # Verify the a panel was rendered
341
+ self .assertIn (b"Response headers" , response .content )
342
+
343
+ @override_settings (DEBUG_TOOLBAR_CONFIG = {"RENDER_PANELS" : False })
344
+ def test_load_panels (self ):
345
+ """
346
+ Test that panels are not rendered during the request with
347
+ RENDER_PANELS=False
348
+ """
349
+ url = "/execute_sql/"
350
+ response = self .client .get (url )
351
+ self .assertIn (b'id="djDebug"' , response .content )
352
+ # Verify the store id is included.
353
+ self .assertIn (b"data-store-id" , response .content )
354
+ # Verify the history panel was not disabled
355
+ self .assertNotIn (
356
+ b'<input type="checkbox" data-cookie="djdtHistoryPanel" '
357
+ b'title="Enable for next and successive requests">' ,
358
+ response .content ,
359
+ )
360
+ # Verify the a panel was not rendered
361
+ self .assertNotIn (b"Response headers" , response .content )
329
362
330
363
def test_view_returns_template_response (self ):
331
364
response = self .client .get ("/template_response/basic/" )
0 commit comments