From c8c239e048c8b9b84a89cb8482a67fb6e85fb724 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sun, 16 Nov 2025 03:04:33 -0500 Subject: Fix pre-existing test failures in Web.py - test_session_persistence: Check for navbar links instead of removed 'Logged in as:' text - test_delete_action: Add referer header to trigger HX-Redirect response --- Biz/PodcastItLater/Web.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Biz/PodcastItLater') diff --git a/Biz/PodcastItLater/Web.py b/Biz/PodcastItLater/Web.py index 767ab84..2868147 100644 --- a/Biz/PodcastItLater/Web.py +++ b/Biz/PodcastItLater/Web.py @@ -1713,9 +1713,9 @@ class TestAuthentication(BaseWebTest): # Access protected page response = self.client.get("/") - # Should see logged-in content - self.assertIn("Logged in as:", response.text) - self.assertIn("test@example.com", response.text) + # Should see logged-in content (navbar with Manage Account link) + self.assertIn("Manage Account", response.text) + self.assertIn("Home", response.text) def test_protected_routes_pending_user(self) -> None: """Pending users should not access protected routes.""" @@ -1982,7 +1982,10 @@ class TestAdminInterface(BaseWebTest): def test_delete_action(self) -> None: """Test delete button functionality.""" - response = self.client.delete(f"/queue/{self.job_id}") + response = self.client.delete( + f"/queue/{self.job_id}", + headers={"referer": "/admin"}, + ) self.assertEqual(response.status_code, 200) self.assertIn("HX-Redirect", response.headers) -- cgit v1.2.3