From b4d20ae0bc898aea6c7d2803b72c72ae2d5e5385 Mon Sep 17 00:00:00 2001
From: Virginia Dooley {% if postelection.is_london_assembly_additional %}{% trans "Additional memb
{% endif %}
{% if postelection.election.electorate %} {{ postelection.election.electorate }} {% else %} - {% trans "Electorate not available" %} + {% trans "None" %} {% endif %} | {% if postelection.election.turnout %} {{ postelection.election.turnout|stringformat:"d%%" }} {% else %} - {% trans "Turnout not available" %} + {% trans "None" %} {% endif %} | {% if postelection.election.ballot_papers_issued %} {{ postelection.election.ballot_papers_issued }} {% else %} - {% trans "Number of ballot papers issued not available" %} + {% trans "None" %} {% endif %} | {% if postelection.election.spoilt_ballots %} {{ postelection.election.spoilt_ballots }} {% else %} - {% trans "Number of spoilt ballots not available" %} + {% trans "None" %} {% endif %} | diff --git a/wcivf/apps/elections/tests/test_election_views.py b/wcivf/apps/elections/tests/test_election_views.py index d6c2498f9..0d5a2ac15 100644 --- a/wcivf/apps/elections/tests/test_election_views.py +++ b/wcivf/apps/elections/tests/test_election_views.py @@ -142,12 +142,18 @@ def test_results_table(self): """check that the table containing the electorate, turnout, spoilt ballots, ballot papers exist for past elections""" + today = str(datetime.today().date()) + self.election.electorate = 100 + self.election.spoilt_ballots = 5 + self.election.save() + response = self.client.get( self.post_election.get_absolute_url(), follow=True ) self.assertEqual(response.status_code, 200) - today = str(datetime.today().date()) + self.assertLess(self.election.election_date, today) + self.assertTrue(self.post_election.election.has_results) self.assertContains(response, "Electorate") self.assertContains(response, "Turnout") self.assertContains(response, "Spoilt Ballots")