"""Tests for workout day viewer routes.""" from fastapi.testclient import TestClient from tests.conftest import set_profile_cookie class TestWorkoutDayViewer: """Tests for GET /workouts/.""" def test_workout_day_requires_profile(self, client: TestClient) -> None: """GET /workouts/push should redirect to / without profile cookie.""" response = client.get("/workouts/push", follow_redirects=False) assert response.status_code == 302 assert response.headers["location"] == "/" def test_workout_days_list_requires_profile(self, client: TestClient) -> None: """GET /workouts should redirect to / without profile cookie.""" response = client.get("/workouts", follow_redirects=False) assert response.status_code == 302 assert response.headers["location"] == "/" def test_workout_days_list_with_profile(self, client: TestClient) -> None: """GET /workouts should succeed with a valid profile cookie.""" set_profile_cookie(client, 1) response = client.get("/workouts") assert response.status_code == 200