You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jl...@apache.org on 2026/07/01 17:12:09 UTC

(superset) 02/02: test(subdirectory): align permalink error-path tests with route_base=""

This is an automated email from the ASF dual-hosted git repository.

sadpandajoe pushed a commit to branch claude/subdirectory-helpers-tdd
in repository https://gitbox.apache.org/repos/asf/superset.git

commit fba11db8e444ecebfdd440c44682031f1815fa89
Author: Joe Li <jo...@preset.io>
AuthorDate: Wed Jul 1 10:10:52 2026 -0700

    test(subdirectory): align permalink error-path tests with route_base=""
    
    The two dashboard-permalink error-path tests still hit the legacy
    `/superset/dashboard/p/<key>/` path, which the B1 legacy-prefix
    RedirectView now 308-redirects to the prefix-free `/dashboard/p/<key>/`
    before the handler runs — so both assert 308 instead of 302/404.
    
    Commit 47d3425 re-pointed the permalink *success* test to the
    prefix-free path but missed these two siblings. Apply the same
    alignment: request `/dashboard/p/123/` and de-prefix the expected
    login redirect URL.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <no...@anthropic.com>
---
 tests/integration_tests/core_tests.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/integration_tests/core_tests.py b/tests/integration_tests/core_tests.py
index 95661c220bc..684c23e292c 100644
--- a/tests/integration_tests/core_tests.py
+++ b/tests/integration_tests/core_tests.py
@@ -968,9 +968,9 @@ class TestCore(SupersetTestCase):
     ):
         get_dashboard_permalink_mock.side_effect = DashboardAccessDeniedError()
 
-        resp = self.client.get("/superset/dashboard/p/123/")
+        resp = self.client.get("/dashboard/p/123/")
 
-        expected_url = "/login/?next=%2Fsuperset%2Fdashboard%2Fp%2F123%2F"
+        expected_url = "/login/?next=%2Fdashboard%2Fp%2F123%2F"
 
         assert resp.status_code == 302
         assert resp.headers["Location"] == expected_url
@@ -984,7 +984,7 @@ class TestCore(SupersetTestCase):
     ):
         get_dashboard_permalink_mock.return_value = None
 
-        resp = self.client.get("/superset/dashboard/p/123/")
+        resp = self.client.get("/dashboard/p/123/")
 
         assert resp.status_code == 404
         assert "Location" not in resp.headers