diff --git a/src/functional_tests/test_room_role_select.py b/src/functional_tests/test_room_role_select.py index b049d01..701c5ff 100644 --- a/src/functional_tests/test_room_role_select.py +++ b/src/functional_tests/test_room_role_select.py @@ -9,10 +9,18 @@ from selenium.webdriver.common.by import By from .base import FunctionalTest, ChannelsFunctionalTest from .management.commands.create_session import create_pre_authenticated_session from apps.applets.models import Applet -from apps.epic.models import Room, GateSlot, TableSeat +from apps.epic.models import DeckVariant, Room, GateSlot, TableSeat from apps.lyric.models import User +def _equip_earthman_deck(user): + """Equip the Earthman DeckVariant so the role-select no-deck guard passes.""" + deck = DeckVariant.objects.filter(name__icontains="Earthman").first() + if deck: + user.equipped_deck = deck + user.save(update_fields=["equipped_deck"]) + + def _fill_room_via_orm(room, emails): """Fill all 6 gate slots and set gate_status=OPEN. Returns list of gamers.""" gamers = [] @@ -713,6 +721,7 @@ class RoleSelectChannelsTest(ChannelsFunctionalTest): def test_observer_sees_seat_arc_during_selection(self): founder, _ = User.objects.get_or_create(email="founder@test.io") + _equip_earthman_deck(founder) User.objects.get_or_create(email="watcher@test.io") room = Room.objects.create(name="Arc Test", owner=founder) _fill_room_via_orm(room, [ @@ -774,6 +783,7 @@ class RoleSelectChannelsTest(ChannelsFunctionalTest): def _make_turn_test_room(self): founder, _ = User.objects.get_or_create(email="founder@test.io") + _equip_earthman_deck(founder) User.objects.get_or_create(email="friend@test.io") room = Room.objects.create(name="Turn Test", owner=founder) _fill_room_via_orm(room, [ @@ -859,6 +869,7 @@ class RoleSelectChannelsTest(ChannelsFunctionalTest): "pal@test.io", "dude@test.io", "bro@test.io", ] founder, _ = User.objects.get_or_create(email="founder@test.io") + _equip_earthman_deck(founder) room = Room.objects.create(name="Last Role Test", owner=founder) _fill_room_via_orm(room, emails) room.table_status = Room.ROLE_SELECT