import pytest @pytest.fixture def setup_response(client): return client.post("/api/v1/auth/setup", json={ "email": "owner@nexadash.local", "password": "StrongPassword123!", "first_name": "Owner", "last_name": "User", }) def test_setup_status(client): r = client.get("/api/v1/auth/setup-status") assert r.status_code == 200 assert "setup_required" in r.json() def test_setup(client, setup_response): assert setup_response.status_code in (200, 400) if setup_response.status_code == 200: assert "access_token" in setup_response.json() def test_login(client, setup_response): r = client.post("/api/v1/auth/login", json={ "email": "owner@nexadash.local", "password": "StrongPassword123!", }) assert r.status_code == 200 assert "access_token" in r.json()