Skip to content

Commit

Permalink
Fix tests by setting ballot to ballot number as expected in the get d…
Browse files Browse the repository at this point in the history
…uplicate results func
  • Loading branch information
JohnMwashuma committed Nov 8, 2024
1 parent 05c1803 commit b2ef44c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tally_ho/apps/tally/tests/views/test_super_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1160,10 +1160,10 @@ def test_get_result_form_with_duplicate_results(self):
# create duplicate final results
create_result(result_form_4, result.candidate, self.user, votes)
ballot_1_duplicates = views.get_result_form_with_duplicate_results(
ballot=ballot_1.pk,
ballot=ballot_1.number,
tally_id=tally.pk)
ballot_2_duplicates = views.get_result_form_with_duplicate_results(
ballot=ballot_2.pk,
ballot=ballot_2.number,
tally_id=tally.pk)
all_duplicates = views.get_result_form_with_duplicate_results(
tally_id=tally.pk)
Expand Down Expand Up @@ -1229,11 +1229,11 @@ def test_duplicate_result_form_view_get(self):
request,
tally_id=tally.pk,
barcode=barcode,
ballot_id=ballot.pk)
ballot_id=ballot.number)
response.render()
self.assertIn(("{}{}").format(
"Duplicate result forms list for ballot: ",
ballot.pk), str(response.content))
ballot.number), str(response.content))
self.assertIn(("{}{}").format("Result form barcode: ",
barcode), str(response.content))
self.assertIn("Send to clearance", str(response.content))
Expand Down Expand Up @@ -1277,7 +1277,7 @@ def test_duplicate_result_form_view_duplicate_reviewed_post(self):
request = self.factory.post('/', data=data)
request.user = self.user
configure_messages(request)
response = view(request, tally_id=tally.pk, ballot_id=ballot.pk)
response = view(request, tally_id=tally.pk, ballot_id=ballot.number)

result_form_1.reload()
result_form_2.reload()
Expand Down Expand Up @@ -1310,7 +1310,7 @@ def test_duplicate_result_form_view_send_clearance_post(self):
request.user = self.user
configure_messages(request)
request.session = {'result_form': result_form.pk}
response = view(request, tally_id=tally.pk, ballot_id=ballot.pk)
response = view(request, tally_id=tally.pk, ballot_id=ballot.number)

result_form.reload()
self.assertEqual(response.status_code, 302)
Expand Down Expand Up @@ -1339,7 +1339,7 @@ def test_duplicate_result_form_view_send_clearance_post(self):
request.user = self.user
configure_messages(request)
request.session = {'result_form': result_form_2.pk}
response = view(request, tally_id=tally.pk, ballot_id=ballot.pk)
response = view(request, tally_id=tally.pk, ballot_id=ballot.number)

result_form_2.reload()
self.assertNotEqual(result_form_2.form_state, FormState.CLEARANCE)
Expand Down Expand Up @@ -1384,7 +1384,7 @@ def test_duplicate_result_form_view_send_all_clearance_post(self):
request = self.factory.post('/', data=data)
request.user = self.user
configure_messages(request)
response = view(request, tally_id=tally.pk, ballot_id=ballot.pk)
response = view(request, tally_id=tally.pk, ballot_id=ballot.number)

result_form_1.reload()
result_form_2.reload()
Expand Down Expand Up @@ -1432,7 +1432,7 @@ def test_duplicate_archived_result_forms_send_all_clearance_post(self):
request = self.factory.post('/', data=data)
request.user = self.user
configure_messages(request)
response = view(request, tally_id=tally.pk, ballot_id=ballot.pk)
response = view(request, tally_id=tally.pk, ballot_id=ballot.number)

result_form_1.reload()
result_form_2.reload()
Expand Down

0 comments on commit b2ef44c

Please sign in to comment.