[WEI] Fix test for 1A registration

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
Yohann D'ANELLO 2021-09-04 13:03:38 +02:00
parent 9523b5f05f
commit 5bf6a5501d
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 7 additions and 52 deletions

View File

@ -84,6 +84,13 @@ class TestWEIRegistration(TestCase):
wei=self.wei, wei=self.wei,
description="Test Bus", description="Test Bus",
) )
# Setup the bus
bus_info = CurrentSurvey.get_algorithm_class().get_bus_information(self.bus)
bus_info.scores["Jus de fruit"] = 70
bus_info.save()
self.bus.save()
self.team = BusTeam.objects.create( self.team = BusTeam.objects.create(
name="Test Team", name="Test Team",
bus=self.bus, bus=self.bus,
@ -761,58 +768,6 @@ class TestDefaultWEISurvey(TestCase):
self.assertEqual(CurrentSurvey.get_year(), 2021) self.assertEqual(CurrentSurvey.get_year(), 2021)
class TestWEISurveyAlgorithm(TestCase):
"""
Run the WEI Algorithm.
TODO: Improve this test with some test data once the algorithm will be implemented.
"""
fixtures = ("initial",)
def setUp(self) -> None:
self.year = timezone.now().year
self.wei = WEIClub.objects.create(
name="Test WEI",
email="gc.wei@example.com",
parent_club_id=2,
membership_fee_paid=12500,
membership_fee_unpaid=5500,
membership_start=date(self.year, 1, 1),
membership_end=date(self.year, 12, 31),
year=self.year,
date_start=date.today() + timedelta(days=2),
date_end=date(self.year, 12, 31),
)
NoteClub.objects.create(club=self.wei)
self.bus = Bus.objects.create(
name="Test Bus",
wei=self.wei,
description="Test Bus",
)
self.team = BusTeam.objects.create(
name="Test Team",
bus=self.bus,
color=0xFFFFFF,
description="Test Team",
)
self.user = User.objects.create(username="toto")
self.registration = WEIRegistration.objects.create(
user_id=self.user.id,
wei_id=self.wei.id,
soge_credit=True,
caution_check=True,
birth_date=date(2000, 1, 1),
gender="nonbinary",
clothing_cut="male",
clothing_size="XL",
health_issues="I am a bot",
emergency_contact_name="Pikachu",
emergency_contact_phone="+33123456789",
first_year=True,
)
CurrentSurvey(self.registration).save()
class TestWeiAPI(TestAPI): class TestWeiAPI(TestAPI):
def setUp(self) -> None: def setUp(self) -> None:
super().setUp() super().setUp()