@@ -157,3 +157,33 @@ def test_merchant_console_renders_for_merchant_user(client) -> None:
157157 assert response .status_code == 200
158158 assert "Merchant Console" in body
159159 assert "Review linked cases" in body
160+
161+
162+ @pytest .mark .django_db
163+ def test_authenticated_console_nav_uses_post_logout_form (client ) -> None :
164+ """The shared console nav should submit logout via POST instead of a GET link."""
165+ ops_user = UserFactory (email = "console-logout@example.com" )
166+ add_group (ops_user , "Ops" )
167+
168+ client .force_login (ops_user )
169+ response = client .get ("/console/ops/" )
170+
171+ body = response .content .decode ()
172+ assert response .status_code == 200
173+ assert 'method="post"' in body
174+ assert 'action="/logout/"' in body
175+ assert "Sign out" in body
176+
177+
178+ @pytest .mark .django_db
179+ def test_admin_console_does_not_render_return_to_landing_button (client ) -> None :
180+ """The admin dashboard should not show a landing-page return action."""
181+ admin_user = UserFactory (email = "console-admin@example.com" , is_superuser = True , is_staff = True )
182+ add_group (admin_user , "Admin" )
183+
184+ client .force_login (admin_user )
185+ response = client .get ("/console/admin/" )
186+
187+ body = response .content .decode ()
188+ assert response .status_code == 200
189+ assert "Return to landing page" not in body
0 commit comments