Fix CI test failures in invite-coach tests #27
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/basketball-api!27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/25-ci-test-failures"
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?
Summary
tests/test_admin.pyadded by PR #24 (invite-coach feature)clientfixture (norequire_adminoverride), exposing two bugs the generate-tokens tests never hitChanges
tests/conftest.py: Setapp.state.auth_configin theclientfixture so pal-e-auth'srequire_role()can run properly and return clean 401/403 instead of 500 "Auth not configured". Theadmin_clientfixture never hit this because it overridesrequire_adminentirely; theclientfixture lets the real auth dependency run, which needsauth_configonapp.state(normally set by the lifespan, which TestClient doesn't trigger outside a context manager).tests/test_admin.py: Fix naive-vs-aware datetime comparison intest_creates_coach_and_returns_invite. TheCoach.invite_expires_atcolumn usesDateTime(no timezone), so SQLAlchemy strips tzinfo on storage. The endpoint's.isoformat()returns a naive string,fromisoformat()parses it as naive, but the test compared againstdatetime.now(timezone.utc)(aware). Fixed by matching tzinfo awareness before comparing.Test Plan
Review Checklist
Related
plan-2026-03-08-tryout-prep-- CI fix for invite-coach tests blocking deploy