CI test-FTs-room #334 fix — _seed_earthman_sig_pile missing is_polarized=True + has_card_images=False defaults (13 errors) + stale id_kit_fiorentine_deck selector → id_kit_tarot_deck (1 error). CI pipeline #334 test-FTs-room reported 1 FAIL + 13 errors after retry on a clean local-green branch; user asked for diagnosis. Two unrelated root causes — both pure FT-helper / FT-selector bugs surfaced by today's earlier landings (15025b4 my_sea single-stack collapse + f107522 RWS rename). No app code touched.
(1) **`_seed_earthman_sig_pile` helper missing two field defaults** — 13 errors + 1 FAIL across `MySeaCardDrawTest`. All 13 errors fail at `_draw_open_modal` line 716 looking for `.sea-deck-stack--levity`; the FAIL at `test_form_col_renders_decks_lock_hand_del_and_reversal_pct` asserts `len(stacks) == 2` and gets 1. Today's15025b4(A.7-polish my_sea single-stack collapse) added `{% if request.user.equipped_deck.is_polarized %}` branching to `my_sea.html:224`: polarized decks render `--gravity` + `--levity` stacks; non-polarized decks render a single `--single` stack. The `_seed_earthman_sig_pile()` helper at `functional_tests/sig_page.py` calls `DeckVariant.objects.get_or_create(slug="earthman", defaults={...})` w. only `name`, `card_count`, `is_default` in the defaults dict — `is_polarized` falls through to the model default of `False` (`epic/models.py:260`). Migration 0012 sets the field on the migration-seeded Earthman row via an explicit `.update(is_polarized=True, has_card_images=False, family="earthman")`, but `TransactionTestCase` flushes all tables on teardown (no `serialized_rollback` per [[feedback-transactiontestcase-flush]]) — once the first test method runs + tears down, the migration-seeded row is gone, and every subsequent test's setUp re-creates Earthman via the helper's incomplete defaults → `is_polarized=False` → my_sea picker renders single-stack → FT selector miss. Why local passed: `MySeaCardDrawTest` is class #5 of 6 in test_game_my_sea.py (setUps at lines 49, 208, 381, 474, 691, 1146); local runs typically scope to a single class or method (per [[feedback-ft-run-discipline]]), so the FIRST setUp finds the migration-seeded Earthman row still intact w. `is_polarized=True` and `get_or_create` returns it as-is. In CI's 152-test FT-room batch, four prior classes each truncate `epic_deckvariant` before class #5 runs, so the helper's defaults are all that's left. Fix: add `is_polarized=True, has_card_images=False` to the helper's defaults dict, mirroring migration 0012's explicit `.update()`. `family` stays implicit since the model default of `EARTHMAN` (`"earthman"`) already matches. Note: the parallel `_equip_earthman` helper in `test_game_room_deck_contrib.py:31-40` carries the same incomplete defaults but its tests don't depend on `is_polarized` — left untouched to avoid scope creep; would tighten consistency in a follow-up if the same trap bites again (2) **Stale `#id_kit_fiorentine_deck` selector** — 1 error at `DeckInUseGameKitTest.test_non_contributing_deck_has_normal_don_doff`.f107522(A.0 image-rendering schema + RWS rename) renamed the existing `fiorentine-minchiate` DeckVariant slug to `tarot-rider-waite-smith` (audit revealed the deck was actually 78-card RWS Tarot, not 97-card Minchiate). The kit panel template at `_applet-game-kit.html:87` derives the element id from `deck.short_key` (`epic/models.py:291`, first dash-separated word of slug) — so `tarot-rider-waite-smith` produces id `id_kit_tarot_deck`, not the old `id_kit_fiorentine_deck`. f107522's rename pass updated `test_game_room_deck_contrib.py`'s click target on line 194 (`#id_kit_tarot_deck`) but missed the immediately-following assertion's `wait_for` selector on line 198, leaving a mixed-slug FT that clicks the new id but waits for the old. Pure FT-selector swap Tests: not run locally per [[feedback-ft-run-discipline]] — both fixes are FT-only (helper defaults + selector string); CI verification on next push will confirm the 14 reds go green. Files: `functional_tests/sig_page.py` (+1, -1) + `functional_tests/test_game_room_deck_contrib.py` (+1, -1) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -37,7 +37,8 @@ def _seed_earthman_sig_pile():
|
||||
separately or extend this helper w. a flag."""
|
||||
earthman, _ = DeckVariant.objects.get_or_create(
|
||||
slug="earthman",
|
||||
defaults={"name": "Earthman", "card_count": 106, "is_default": True},
|
||||
defaults={"name": "Earthman", "card_count": 106, "is_default": True,
|
||||
"is_polarized": True, "has_card_images": False},
|
||||
)
|
||||
_NAME = {11: "Maid", 12: "Jack", 13: "Queen", 14: "King"}
|
||||
for suit in ("BRANDS", "CROWNS", "BLADES", "GRAILS"):
|
||||
|
||||
@@ -195,7 +195,7 @@ class DeckInUseGameKitTest(FunctionalTest):
|
||||
).click()
|
||||
don_btn = self.wait_for(
|
||||
lambda: self.browser.find_element(
|
||||
By.CSS_SELECTOR, "#id_kit_fiorentine_deck .btn-equip"
|
||||
By.CSS_SELECTOR, "#id_kit_tarot_deck .btn-equip"
|
||||
)
|
||||
)
|
||||
self.assertNotIn("btn-disabled", don_btn.get_attribute("class"))
|
||||
|
||||
Reference in New Issue
Block a user