new migrations in apps.epic & apps.lyric apps; new Token fields of latter articulate upon Room model helper fns of former; new FTs, ITs & UTs capture new behavior accordingly; new template partial content in templates/apps/gameboard

This commit is contained in:
Disco DeDisco
2026-03-13 17:31:52 -04:00
parent 5773462b4c
commit 6a42b91420
12 changed files with 239 additions and 9 deletions

View File

@@ -29,3 +29,24 @@ class RoomCreationViewTest(TestCase):
reverse("epic:create_room"),
data={"name": "Test Room"},
)
class MyGamesContextTest(TestCase):
def setUp(self):
self.user = User.objects.create(email="gamer@example.com")
self.client.force_login(self.user)
def test_gameboard_context_includes_owned_rooms(self):
room = Room.objects.create(name="Durango", owner=self.user)
response = self.client.get("/gameboard/")
self.assertIn(room, response.context["my_games"])
def test_gameboard_context_includes_rooms_with_filled_slot(self):
other = User.objects.create(email="friend@example.com")
room = Room.objects.create(name="Their Room", owner=other)
slot = room.gate_slots.get(slot_number=2)
slot.gamer = self.user
slot.status = "FILLED"
slot.save()
response = self.client.get("/gameboard/")
self.assertIn(room, response.context["my_games"])