From af7bfb814d232a537ed742a48ee33b773d53fa5e Mon Sep 17 00:00:00 2001 From: Tim Schilling Date: Fri, 12 Sep 2025 10:24:12 -0500 Subject: [PATCH 1/2] Changed StoredDebugToolbar.from_store to always create panel keys. This fixes the issue where panels that don't call record_stats aren't fetchable in render_panel. --- debug_toolbar/toolbar.py | 5 ++--- docs/changes.rst | 2 ++ tests/panels/test_history.py | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) 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..05da4775d 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -8,6 +8,8 @@ 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. 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) From 4f8be05a55fee3819676a2890f081c61a15158c6 Mon Sep 17 00:00:00 2001 From: Tim Schilling Date: Fri, 12 Sep 2025 10:51:29 -0500 Subject: [PATCH 2/2] Fixed selenium tests for CI by using psycopg for Python 3.13 runs. --- .github/workflows/test.yml | 2 +- docs/changes.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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/docs/changes.rst b/docs/changes.rst index 05da4775d..2f9973731 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -10,6 +10,7 @@ Pending 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) ------------------