Skip to content

Add unit tests for authentication API #2

@wisdomqin

Description

@wisdomqin

Description

The auth module (backend/app/api/auth.py) currently has no automated tests. Adding basic test coverage would improve code reliability.

What to do

  1. Create backend/tests/test_auth.py
  2. Add tests for key endpoints:
    • POST /api/auth/register — successful registration
    • POST /api/auth/login — successful login, wrong password
    • GET /api/auth/me — authenticated vs unauthenticated
  3. Use pytest + httpx (already in dev dependencies)

Resources

  • Auth router: backend/app/api/auth.py
  • Test config: backend/pyproject.toml (asyncio_mode = auto)
  • Run tests: cd backend && .venv/bin/pytest

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions