Summary
The e2e_user_with_tokens fixture in tests/e2e/conftest.py:97 can never succeed — it logs in with a different password than the one the user was created with.
Evidence
tests/e2e/conftest.py:91 e2e_user creates the user with user.set_password("testpassword123")
tests/e2e/conftest.py:97-123 e2e_user_with_tokens posts login with "password": "e2e_test password" (mismatch)
Flow when the fixture is used:
POST /api/auth/login → 401 (wrong password)
POST /api/auth/register → 409 (email already exists, auth_routes.py:104-105)
POST /api/auth/login again → 401
data["access_token"] → KeyError
Impact
Latent landmine — no test currently depends on these fixtures, so the suite passes today, but the first e2e test that uses e2e_user_with_tokens / e2e_auth_headers will crash at fixture setup.
Suggested fix
Use the same password in both fixtures, e.g. a shared constant E2E_PASSWORD = "testpassword123", and align e2e_user_with_tokens (and the register fallback in it) accordingly.
Verification
Add/run a test that uses e2e_user_with_tokens (e.g. e2e_client + e2e_auth_headers), or a quick pytest on tests/e2e.
Summary
The
e2e_user_with_tokensfixture intests/e2e/conftest.py:97can never succeed — it logs in with a different password than the one the user was created with.Evidence
tests/e2e/conftest.py:91e2e_usercreates the user withuser.set_password("testpassword123")tests/e2e/conftest.py:97-123e2e_user_with_tokensposts login with"password": "e2e_test password"(mismatch)Flow when the fixture is used:
POST /api/auth/login→ 401 (wrong password)POST /api/auth/register→ 409 (email already exists,auth_routes.py:104-105)POST /api/auth/loginagain → 401data["access_token"]→KeyErrorImpact
Latent landmine — no test currently depends on these fixtures, so the suite passes today, but the first e2e test that uses
e2e_user_with_tokens/e2e_auth_headerswill crash at fixture setup.Suggested fix
Use the same password in both fixtures, e.g. a shared constant
E2E_PASSWORD = "testpassword123", and aligne2e_user_with_tokens(and the register fallback in it) accordingly.Verification
Add/run a test that uses
e2e_user_with_tokens(e.g.e2e_client+e2e_auth_headers), or a quick pytest ontests/e2e.