new migrations in apps.epic for .models additions, incl. Significator select order (= Start Role seat order), which cards of whom go into which deck, which are brought into Sig select; new select-sig urlpattern in .views; room.html supports this stage of game now
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Disco DeDisco
2026-03-25 01:50:06 -04:00
parent c0016418cc
commit b3bc422f46
7 changed files with 159 additions and 70 deletions

View File

@@ -224,37 +224,16 @@ class RoomInviteTest(TestCase):
SIG_SEAT_ORDER = ["PC", "NC", "EC", "SC", "AC", "BC"]
def _make_sig_cards(deck):
"""Create the 18 unique TarotCard types used in the Significator deck."""
for suit in ["WANDS", "CUPS", "SWORDS", "PENTACLES"]:
for number, court in [(11, "Maid"), (12, "Jack"), (13, "Queen"), (14, "King")]:
TarotCard.objects.create(
deck_variant=deck, arcana="MINOR", suit=suit, number=number,
name=f"{court} of {suit.capitalize()}",
slug=f"{court.lower()}-of-{suit.lower()}-em",
keywords_upright=[], keywords_reversed=[],
)
TarotCard.objects.create(
deck_variant=deck, arcana="MAJOR", number=0,
name="The Schiz", slug="the-schiz",
keywords_upright=[], keywords_reversed=[],
)
TarotCard.objects.create(
deck_variant=deck, arcana="MAJOR", number=1,
name="Pope 1: Chancellor", slug="pope-1-chancellor",
keywords_upright=[], keywords_reversed=[],
)
def _full_sig_room(name="Sig Room", role_order=None):
"""Return (room, gamers, earthman) with all 6 seats filled, roles assigned,
table_status=SIG_SELECT, and every gamer's equipped_deck set to Earthman."""
table_status=SIG_SELECT, and every gamer's equipped_deck set to Earthman.
Uses get_or_create for DeckVariant — migration data persists in TestCase."""
if role_order is None:
role_order = SIG_SEAT_ORDER[:]
earthman = DeckVariant.objects.create(
slug="earthman", name="Earthman Deck", card_count=108, is_default=True
earthman, _ = DeckVariant.objects.get_or_create(
slug="earthman",
defaults={"name": "Earthman Deck", "card_count": 108, "is_default": True},
)
_make_sig_cards(earthman)
owner = User.objects.create(email="founder@sig.io")
gamers = [owner]
for i in range(2, 7):
@@ -355,13 +334,12 @@ class SigCardFieldTest(TestCase):
"""TableSeat.significator FK to TarotCard — default null, assignable."""
def setUp(self):
earthman = DeckVariant.objects.create(
slug="earthman", name="Earthman Deck", card_count=108, is_default=True
earthman, _ = DeckVariant.objects.get_or_create(
slug="earthman",
defaults={"name": "Earthman Deck", "card_count": 108, "is_default": True},
)
self.card = TarotCard.objects.create(
self.card = TarotCard.objects.get(
deck_variant=earthman, arcana="MINOR", suit="WANDS", number=11,
name="Maid of Wands", slug="maid-of-wands-em",
keywords_upright=[], keywords_reversed=[],
)
owner = User.objects.create(email="owner@test.io")
room = Room.objects.create(name="Field Test", owner=owner)