Skip to content

Bug: e2e_user_with_tokens fixture password mismatch — will crash any test that uses it #33

Description

@Alimedhat000

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:

  1. POST /api/auth/login → 401 (wrong password)
  2. POST /api/auth/register → 409 (email already exists, auth_routes.py:104-105)
  3. POST /api/auth/login again → 401
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions