plugged some test coverage lacunae, incl. tests for release_slot for the Carte Blanche; select_role for ROLE_CHOICES & ROLE_SELECT; equip_trinket non-POST paths; & tooltip_shoptalk for the Tithe Token
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Disco DeDisco
2026-03-19 00:00:00 -04:00
parent 8c2a5d24ec
commit 5a811d0079
3 changed files with 68 additions and 1 deletions

View File

@@ -4,7 +4,7 @@ from django.test import TestCase
from django.urls import reverse
from apps.applets.models import Applet, UserApplet
from apps.lyric.models import User
from apps.lyric.models import Token, User
class GameboardViewTest(TestCase):
@@ -101,3 +101,17 @@ class ToggleGameAppletsViewTest(TestCase):
)
self.client.post(self.url, {"applets": ["new-game", "my-games"]})
self.assertFalse(UserApplet.objects.filter(user=self.user, applet=dash_applet).exists())
class EquipTrinketViewTest(TestCase):
def setUp(self):
self.user = User.objects.create(email="gamer@test.io")
self.client.force_login(self.user)
self.token = Token.objects.filter(user=self.user, token_type=Token.COIN).first()
def test_get_returns_trinket_button_partial(self):
response = self.client.get(
reverse("equip_trinket", kwargs={"token_id": self.token.pk})
)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "apps/gameboard/_partials/_equip_trinket_btn.html")