forked from 0xWheatyz/SPARC
Test: Add JWT authentication flow tests to test_api.py #473
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Roadmap item: P1 - Test coverage for auth and admin
Problem
The existing
tests/test_api.pybypasses authentication entirely. There is no test coverage for the JWT registration/login flow, protected routes, token refresh, or admin-only endpoints.Task
Add tests that exercise:
POST /auth/register).POST /auth/login).Acceptance Criteria
auth.pyis above 80%.Already implemented. Comprehensive JWT authentication flow tests exist in
tests/test_auth.py, covering registration (first user admin, subsequent user, duplicate email), login (valid/invalid credentials), protected routes, token refresh, and admin access. Closing as completed.