Sprint 4 PR 4.6b — integration tests for organizations router - #231
Merged
Merged
Conversation
Summary: extend the resurrected tests/integration/ tier (Sprint 4 PR 4.6b) with a fourth production-endpoint file that drives the /organizations router over real HTTP against the session-scoped uvicorn api_server fixture. Covers create + duplicate rejection, get, list-envelope + q-search + include_cancelled=true/false, PUT partial update + 404, admin-gated cancel/restore including the missing-bearer-token 403 check, and hard delete + 404. Changed files: tests/integration/test_organizations.py (new, 15 tests) Validation: poetry run pytest tests/integration/ -q # 58 passed poetry run pytest tests/integration/test_organizations.py -v # 15 passed poetry run pytest tests/unit -q # 342 passed, 21 skipped poetry run black tests/integration/test_organizations.py poetry run ruff check tests/integration/test_organizations.py Follow-ups: continue file-by-file revival with events, teams, and availability routers under tests/integration/ to broaden real-HTTP coverage of the active surface.
tomqwu
marked this pull request as ready for review
July 17, 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 fourth production-endpoint integration file that drives the/organizationsrouter over real HTTP against the session-scoped uvicornapi_serverfixture (introduced in PR 4.6a).Coverage
tests/integration/test_organizations.py— 15 tests covering:POST /organizations/— success + duplicate-id 409GET /organizations/{id}— success + 404GET /organizations/— envelope shape,q=search filter,include_cancelled=true|falsetogglePUT /organizations/{id}— partial update + 404POST /organizations/{id}/canceland/restore— admin gate (403 without bearer), sets/clearscancelled_at/data_retention_until/deletion_scheduled_atDELETE /organizations/{id}— success + 404Validation
poetry run pytest tests/integration/— 58 passed (was 43)poetry run pytest tests/integration/test_organizations.py -v— 15 passedpoetry run pytest tests/unit -q— 342 passed, 21 skippedpoetry run black tests/integration/test_organizations.py— cleanpoetry run ruff check tests/integration/test_organizations.py— cleanNo OpenAPI snapshot refresh (no endpoints added or changed).
Notes
q=(baked into the fixture's org name) so the assertion isn't sensitive to unrelated orgs created by concurrent tests spilling past page 1 of the default pagination.403(FastAPIHTTPBearerreturns 403, not 401, when theAuthorizationheader is missing).Follow-ups
Next integration files to revive: events, teams, availability.
Generated by Claude Code