Repository navigation
Sprint 4 PR 4.6b — integration tests for password-reset router - #242
Merged
Merged
Conversation
Summary: Continues PR 4.6b file-by-file revival of the integration tier.
Adds real-HTTP coverage for /api/v1/auth/{forgot,reset}-password over
the session-scoped uvicorn api_server. Uses DEBUG_RETURN_RESET_TOKEN
(set at test-module import time before api_server picks up the env) so
the raw reset token is exposed and the full request → confirm → old
password rejected flow can be exercised.
Changed files:
- tests/integration/test_password_reset.py (new) — 7 tests covering:
- /forgot-password: known email 200, unknown email same generic
shape (anti-enumeration), malformed email 422
- /reset-password: bogus token 400, empty token 400, happy-path
reset + new password authenticates + old password rejected,
token single-use (second submission with the same token 400)
Validation:
- poetry run pytest tests/integration/test_password_reset.py -v — 7 passed
- poetry run black tests/integration/test_password_reset.py — clean
- poetry run ruff check tests/integration/test_password_reset.py — clean
- No OpenAPI snapshot refresh (no endpoints added or changed).
Follow-ups:
- Remaining integration files to revive: assignments, analytics,
calendar, solutions, solver, people, webhooks.
tomqwu
marked this pull request as ready for review
July 19, 2026 13:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Continues Sprint 4 PR 4.6b (file-by-file revival of the
tests/integration/tier). Adds a production-endpoint integration file that drives/auth/forgot-passwordand/auth/reset-passwordover real HTTP against the session-scoped uvicornapi_serverfixture. SetsDEBUG_RETURN_RESET_TOKEN=trueat module import time (before pytest instantiates the session-scopedapi_serverfixture) so the raw reset token is returned in the JSON body and the full flow can be exercised end-to-end.Coverage
tests/integration/test_password_reset.py— 7 tests covering:POST /auth/forgot-password— known email 200 (with token when debug flag is on), unknown email 200 with identical shape (anti-enumeration), malformed email 422POST /auth/reset-password— bogus token 400, empty token 400, full happy path (request → confirm → new password authenticates + old password 401), token single-use (second submission of the same token 400)Validation
poetry run pytest tests/integration/test_password_reset.py -v— 7 passedpoetry run black tests/integration/test_password_reset.py— cleanpoetry run ruff check tests/integration/test_password_reset.py— cleanNo OpenAPI snapshot refresh (no endpoints added or changed).
Notes
DEBUG_RETURN_RESET_TOKENis set: theypytest.skiprather than fail. That path never triggers today because pytest collects (imports) test files before starting the session fixture."message" in bodyand"token" not in body— the second half is what actually forbids enumeration; the router must not leak "matched" via a differing shape.Follow-ups
Remaining routers still to revive under
tests/integration/: assignments, analytics, calendar, solutions, solver, people, webhooks.Generated by Claude Code