fix: align player detail test with populated_db fixture jersey state #253

Merged
forgejo_admin merged 1 commit from 252-fix-test-fixture-collision-between-jerse into main 2026-03-29 22:25:11 +00:00
Contributor

Summary

PR #250 added jersey fields to the shared populated_db fixture (setting jersey_order_status=paid on player1). PR #251 added the player detail endpoint test asserting jersey_order_status == "none" for the same player. Each passed individually but collide when both are on main, failing CI pipeline #254.

Changes

  • tests/test_admin_spa.py: Updated TestAdminPlayerDetail.test_returns_player_detail to assert jersey_order_status == "paid" (matching fixture) instead of "none". Added assertions for jersey_option, jersey_size, and jersey_number fields that were missing from the detail test but present in the fixture.

Test Plan

  • pytest tests/test_admin_spa.py -v -- all 14 tests pass (was 8 failures before fix)
  • ruff format --check and ruff check pass
  • No regressions in admin SPA tests

Review Checklist

  • Passed automated review-fix loop
  • No secrets committed
  • No unnecessary file changes
  • Commit messages are descriptive
  • Closes #252
  • Root cause: fixture collision between #250 and #251
## Summary PR #250 added jersey fields to the shared `populated_db` fixture (setting `jersey_order_status=paid` on player1). PR #251 added the player detail endpoint test asserting `jersey_order_status == "none"` for the same player. Each passed individually but collide when both are on main, failing CI pipeline #254. ## Changes - `tests/test_admin_spa.py`: Updated `TestAdminPlayerDetail.test_returns_player_detail` to assert `jersey_order_status == "paid"` (matching fixture) instead of `"none"`. Added assertions for `jersey_option`, `jersey_size`, and `jersey_number` fields that were missing from the detail test but present in the fixture. ## Test Plan - [x] `pytest tests/test_admin_spa.py -v` -- all 14 tests pass (was 8 failures before fix) - [x] `ruff format --check` and `ruff check` pass - [x] No regressions in admin SPA tests ## Review Checklist - [x] Passed automated review-fix loop - [x] No secrets committed - [x] No unnecessary file changes - [x] Commit messages are descriptive ## Related Notes - Closes #252 - Root cause: fixture collision between #250 and #251
fix: align player detail test assertions with populated_db fixture jersey state
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
67779b4229
PR #250 set jersey fields on player1 in the shared populated_db fixture
(jersey_order_status=paid, jersey_option=reversible, jersey_size=YL,
jersey_number=23). PR #251 added the player detail test asserting
jersey_order_status=="none", causing a collision on main. Update the
assertion to match the fixture and add coverage for the other jersey fields.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Contributor

QA Review

Scope: 1 file changed, 5 additions, 1 deletion (test-only)

Diff Analysis

The populated_db fixture sets player1 with:

  • jersey_option=JerseyOption.reversible
  • jersey_size=JerseySize.YL
  • jersey_number="23"
  • jersey_order_status=JerseyOrderStatus.paid

The old assertion assert data["jersey_order_status"] == "none" directly contradicts this fixture state. The fix correctly updates to "paid" and adds the three missing jersey field assertions (jersey_option, jersey_size, jersey_number), improving test coverage.

Checklist

  • Fix matches the fixture data exactly
  • No unrelated changes
  • No secrets or sensitive data
  • Test plan confirms all 14 tests pass
  • Ruff lint and format pass

Nits

None.

VERDICT: APPROVED

## QA Review **Scope:** 1 file changed, 5 additions, 1 deletion (test-only) ### Diff Analysis The `populated_db` fixture sets player1 with: - `jersey_option=JerseyOption.reversible` - `jersey_size=JerseySize.YL` - `jersey_number="23"` - `jersey_order_status=JerseyOrderStatus.paid` The old assertion `assert data["jersey_order_status"] == "none"` directly contradicts this fixture state. The fix correctly updates to `"paid"` and adds the three missing jersey field assertions (`jersey_option`, `jersey_size`, `jersey_number`), improving test coverage. ### Checklist - [x] Fix matches the fixture data exactly - [x] No unrelated changes - [x] No secrets or sensitive data - [x] Test plan confirms all 14 tests pass - [x] Ruff lint and format pass ### Nits None. **VERDICT: APPROVED**
forgejo_admin deleted branch 252-fix-test-fixture-collision-between-jerse 2026-03-29 22:25:11 +00:00
Sign in to join this conversation.
No description provided.