mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 01:48:21 +02:00
tests
This commit is contained in:
@ -33,8 +33,8 @@ class TestWEIAlgorithm(TestCase):
|
||||
bus = Bus.objects.create(wei=self.wei, name=f"Bus {i}", size=10)
|
||||
self.buses.append(bus)
|
||||
information = WEIBusInformation2023(bus)
|
||||
for word in WORDS:
|
||||
information.scores[word] = random.randint(0, 101)
|
||||
for question in WORDS:
|
||||
information.scores[question] = {answer: random.randint(1, 5) for answer in WORDS[question][1]}
|
||||
information.save()
|
||||
bus.save()
|
||||
|
||||
@ -52,8 +52,8 @@ class TestWEIAlgorithm(TestCase):
|
||||
birth_date='2000-01-01',
|
||||
)
|
||||
information = WEISurveyInformation2023(registration)
|
||||
for j in range(1, 21):
|
||||
setattr(information, f'word{j}', random.choice(WORDS))
|
||||
for question in WORDS:
|
||||
setattr(information, question, random.randint(1, 5))
|
||||
information.step = 20
|
||||
information.save(registration)
|
||||
registration.save()
|
||||
@ -82,8 +82,8 @@ class TestWEIAlgorithm(TestCase):
|
||||
birth_date='2000-01-01',
|
||||
)
|
||||
information = WEISurveyInformation2023(registration)
|
||||
for j in range(1, 21):
|
||||
setattr(information, f'word{j}', random.choice(WORDS))
|
||||
for question in WORDS:
|
||||
setattr(information, question, random.randint(1, 5))
|
||||
information.step = 20
|
||||
information.save(registration)
|
||||
registration.save()
|
||||
|
Reference in New Issue
Block a user