1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-22 10:28:21 +02:00

Correction des tests et autres

This commit is contained in:
Ehouarn
2025-06-12 17:39:34 +02:00
parent 63f6528adc
commit 6822500fdc
4 changed files with 24 additions and 10 deletions

View File

@ -337,7 +337,7 @@ class TestWEIRegistration(TestCase):
emergency_contact_phone='+33123456789',
bus=[self.bus.id],
team=[self.team.id],
roles=[role.id for role in WEIRole.objects.filter(~Q(name="1A")).all()],
roles=[role.id for role in WEIRole.objects.filter(~Q(name="1A") & ~Q(name="GC WEI")).all()],
caution_type='check'
))
qs = WEIRegistration.objects.filter(user_id=user.id)
@ -632,7 +632,7 @@ class TestWEIRegistration(TestCase):
second_bus = Bus.objects.create(wei=self.wei, name="Second bus")
second_team = BusTeam.objects.create(bus=second_bus, name="Second team", color=42)
response = self.client.post(reverse("wei:validate_registration", kwargs=dict(pk=self.registration.pk)), dict(
roles=[WEIRole.objects.get(name="GC WEI").id],
roles=[WEIRole.objects.get(name="Adhérent⋅e WEI").id],
bus=self.bus.pk,
team=second_team.pk,
credit_type=4, # Bank transfer
@ -647,7 +647,7 @@ class TestWEIRegistration(TestCase):
self.assertTrue("This team doesn't belong to the given bus." in str(response.context["form"].errors))
response = self.client.post(reverse("wei:validate_registration", kwargs=dict(pk=self.registration.pk)), dict(
roles=[WEIRole.objects.get(name="GC WEI").id],
roles=[WEIRole.objects.get(name="Adhérent⋅e WEI").id],
bus=self.bus.pk,
team=self.team.pk,
credit_type=4, # Bank transfer