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
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -775,35 +775,15 @@ class ReleaseSlotViewTest(TestCase):
|
||||
SIG_SEAT_ORDER = ["PC", "NC", "EC", "SC", "AC", "BC"]
|
||||
|
||||
|
||||
def _make_sig_cards(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_setUp(test_case, role_order=None):
|
||||
"""Populate test_case with a SIG_SELECT room; return (room, gamers, earthman, card_in_deck)."""
|
||||
"""Populate test_case with a SIG_SELECT room; return (room, gamers, earthman, card_in_deck).
|
||||
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)
|
||||
founder = User.objects.create(email="founder@test.io")
|
||||
gamers = [founder]
|
||||
for i in range(2, 7):
|
||||
@@ -896,10 +876,10 @@ class SelectSigCardViewTest(TestCase):
|
||||
self.assertEqual(response.status_code, 403)
|
||||
|
||||
def test_select_sig_card_not_in_deck_returns_400(self):
|
||||
# Create a card that is not in the sig deck (e.g. a pip card)
|
||||
# Create a pip card (number=5) — not in the sig deck (only court 11–14 + major 0–1)
|
||||
other = TarotCard.objects.create(
|
||||
deck_variant=self.earthman, arcana="MINOR", suit="WANDS", number=5,
|
||||
name="Five of Wands", slug="five-of-wands-em",
|
||||
name="Five of Wands Test", slug="five-of-wands-test",
|
||||
keywords_upright=[], keywords_reversed=[],
|
||||
)
|
||||
response = self._post(card_id=other.id)
|
||||
|
||||
Reference in New Issue
Block a user