diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0688bb04c..63ed64057 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -89,7 +89,7 @@ jobs: - python-version: '3.13' database: postgis3 - python-version: '3.13' - database: postgresql + database: psycopg3 env: DJANGO_SELENIUM_TESTS=true diff --git a/debug_toolbar/toolbar.py b/debug_toolbar/toolbar.py index 6ebc74234..38f1a3803 100644 --- a/debug_toolbar/toolbar.py +++ b/debug_toolbar/toolbar.py @@ -221,9 +221,8 @@ def from_store(cls, request_id, panel_id=None): if panel_id and panel.panel_id != panel_id: continue data = toolbar.store.panel(toolbar.request_id, panel.panel_id) - if data: - panel.load_stats_from_store(data) - toolbar._panels[panel.panel_id] = panel + panel.load_stats_from_store(data) + toolbar._panels[panel.panel_id] = panel return toolbar diff --git a/docs/changes.rst b/docs/changes.rst index 569f88975..2f9973731 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -8,6 +8,9 @@ Pending * Removed logging about the toolbar failing to serialize a value into JSON. * Moved the the import statement of ``debug_toolbar.urls`` to within the if statement's scope on the installation documentation. +* Changed ``StoredDebugToolbar.from_store`` to always create a panel key and + class instance, regardless if any data was generated. +* Fixed selenium tests for CI by using psycopg for Python 3.13 runs. 6.0.0 (2025-07-22) ------------------ diff --git a/tests/panels/test_history.py b/tests/panels/test_history.py index 29e062da0..fbc338ba9 100644 --- a/tests/panels/test_history.py +++ b/tests/panels/test_history.py @@ -5,6 +5,7 @@ from django.urls import resolve, reverse from debug_toolbar.panels.history import HistoryPanel +from debug_toolbar.panels.redirects import RedirectsPanel from debug_toolbar.store import get_store from debug_toolbar.toolbar import DebugToolbar @@ -80,6 +81,7 @@ class HistoryViewsTestCase(IntegrationTestCase): "AlertsPanel", "CachePanel", "SignalsPanel", + "ProfilingPanel", } def test_history_panel_integration_content(self): @@ -138,6 +140,7 @@ def test_history_sidebar_includes_history(self): self.client.get("/json_view/") panel_keys = copy.copy(self.PANEL_KEYS) panel_keys.add(HistoryPanel.panel_id) + panel_keys.add(RedirectsPanel.panel_id) request_id = list(get_store().request_ids())[0] data = {"request_id": request_id} response = self.client.get(reverse("djdt:history_sidebar"), data=data)