Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnMwashuma committed Aug 13, 2024
1 parent 84fc365 commit 4c57b2f
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,12 @@ def test_result_form_result_list_data_view_filters(self):
self.assertEqual(
len(json.loads(response.content.decode())['data']), 2)

# test sub constituency filter
data = {'data': '{"sub_con_codes": ' + f'["{self.sc.code}"]' + '}'}
response = self.apply_filter(data)
self.assertEqual(
len(json.loads(response.content.decode())['data']), 2)

def test_administrative_areas_reports_views(self):
# test ActiveCandidatesVotesListView
tally = create_tally()
Expand Down Expand Up @@ -466,7 +472,8 @@ def test_export_results_queryset(self):
'ballot_status': ['available_for_release'],
'station_status': ['active'],
'candidate_status': ['active'],
'percentage_processed': 75
'percentage_processed': 75,
'sub_con_codes': [self.sc.code]
}
export_qs = admin_reports.export_results_queryset(
tally_id=self.tally.id, qs=qs, data=data)
Expand Down Expand Up @@ -592,6 +599,7 @@ def test_get_export(self):
'exportType': 'PPT',
'select_1_ids': center_ids,
'select_2_ids': station_ids,
'sub_con_codes': [self.sc.code]
}
request = self.factory.get('/')
request.user = self.user
Expand Down

0 comments on commit 4c57b2f

Please sign in to comment.