Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POLIO-1817: fix flaky test #1909

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions plugins/polio/tests/test_vaccine_repository_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,18 @@ def test_rounds_are_split_by_vaccine(self):

response = self.client.get(f"{BASE_URL}?campaign={campaign2.obr_name}&order=number")
data = response.json()
print("RESULTS", data["results"])
self.assertEqual(len(data["results"]), 6) # 3 rounds * 2 vaccines = 6
# Check first 2 entrieds are the same round...
self.assertEqual(data["results"][0]["campaign_obr_name"], campaign2.obr_name)
self.assertEqual(data["results"][0]["number"], 1)
self.assertEqual(data["results"][0]["vaccine_name"], pm.VACCINES[0][0])
self.assertEqual(data["results"][1]["campaign_obr_name"], campaign2.obr_name)
self.assertEqual(data["results"][1]["number"], 1)
self.assertEqual(data["results"][1]["vaccine_name"], pm.VACCINES[1][0])
# ... but not the same vaccine
self.assertNotEqual(data["results"][0]["vaccine_name"], data["results"][1]["vaccine_name"])
# Check that each is one of the 2 expected vaccines
self.assertTrue(data["results"][0]["vaccine_name"] in [pm.VACCINES[0][0], pm.VACCINES[1][0]])
self.assertTrue(data["results"][1]["vaccine_name"] in [pm.VACCINES[0][0], pm.VACCINES[1][0]])

def test_ordering(self):
"""Test ordering functionality"""
Expand Down
Loading