|
4 | 4 | from django.test import RequestFactory, override_settings |
5 | 5 | from django.urls import resolve, reverse |
6 | 6 |
|
| 7 | +from debug_toolbar.panels.history import HistoryPanel |
7 | 8 | from debug_toolbar.store import get_store |
8 | 9 | from debug_toolbar.toolbar import DebugToolbar |
9 | 10 |
|
|
14 | 15 |
|
15 | 16 |
|
16 | 17 | class HistoryPanelTestCase(BaseTestCase): |
17 | | - panel_id = "HistoryPanel" |
| 18 | + panel_id = HistoryPanel.panel_id |
18 | 19 |
|
19 | 20 | def test_disabled(self): |
20 | 21 | config = {"DISABLE_PANELS": {"debug_toolbar.panels.history.HistoryPanel"}} |
@@ -93,7 +94,7 @@ def test_history_panel_integration_content(self): |
93 | 94 | request_ids = list(store.request_ids()) |
94 | 95 | self.assertEqual(len(request_ids), 1) |
95 | 96 | toolbar = DebugToolbar.fetch(request_ids[0]) |
96 | | - content = toolbar.get_panel_by_id("HistoryPanel").content |
| 97 | + content = toolbar.get_panel_by_id(HistoryPanel.panel_id).content |
97 | 98 | self.assertIn("bar", content) |
98 | 99 | self.assertIn('name="exclude_history" value="True"', content) |
99 | 100 |
|
@@ -131,7 +132,7 @@ def test_history_sidebar_includes_history(self): |
131 | 132 | """Validate the history sidebar view.""" |
132 | 133 | self.client.get("/json_view/") |
133 | 134 | panel_keys = copy.copy(self.PANEL_KEYS) |
134 | | - panel_keys.add("HistoryPanel") |
| 135 | + panel_keys.add(HistoryPanel.panel_id) |
135 | 136 | request_id = list(get_store().request_ids())[0] |
136 | 137 | data = {"request_id": request_id} |
137 | 138 | response = self.client.get(reverse("djdt:history_sidebar"), data=data) |
|
0 commit comments