Skip to content

Commit

Permalink
Update pre-sopn text when candidates exist
Browse files Browse the repository at this point in the history
  • Loading branch information
VirginiaDooley committed Sep 21, 2023
1 parent aa83d6a commit 35991c3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
6 changes: 3 additions & 3 deletions ynr/apps/elections/templates/elections/ballot_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ <h1>Candidates for {{ ballot.post.label }} on <br>{{ ballot.election.election_da

{% if not ballot.candidates_locked and candidates.exists %}
<div class="panel">
<p>These {{ ballot.num_candidates }} candidates haven't been confirmed by the official "nomination papers"
from the council yet. This means they might not all end up on the ballot paper.</p>
<p>We will manually verify each candidate when the nomination papers are published.</p>
<p>These candidates will not be confirmed until the council publishes the official candidate list on {{ballot.expected_sopn_date}}.
Once nomination papers are published, we will manually verify each candidate.
</p>
</div>
{% endif %}

Expand Down
34 changes: 24 additions & 10 deletions ynr/apps/elections/tests/test_ballot_view.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import datetime
from random import randrange

from candidates.models import PartySet
Expand Down Expand Up @@ -125,34 +126,47 @@ def test_ballot_sopn_upload_link(self):
)

def test_ballot_with_candidates_no_sopn(self):
self.election.election_date = datetime.date(2019, 8, 3)
self.election.save()
self.ballot.post.territory_code = "ENG"
self.ballot.save()
self.create_memberships(self.ballot, self.parties)

response = self.app.get(self.ballot.get_absolute_url())

self.assertEqual(
self.ballot.expected_sopn_date, datetime.date(2019, 7, 10)
)
self.assertFalse(self.ballot.candidates_locked)
self.assertEqual(response.context["candidates"].count(), 9)
self.assertDataTimelineCandidateAddingInProgress(response)
expected_header = """
<h1>Candidates for Bar Ward on<br>3 August 2019</h1>
"""
self.assertInHTML(
f"<h1>Candidates for Bar Ward on <br>{ self.election.election_date.strftime('%d %B %Y') }</h1>",
expected_header,
response.text,
)
self.assertInHTML(
"""
expected_notice = """
<p>
These 9 candidates haven't been confirmed by the official
"nomination papers" from the council yet. This means they might
not all end up on the ballot paper.
These candidates will not be confirmed until the council publishes the official candidate list on 10 July 2019.
Once nomination papers are published, we will manually verify each candidate.
</p>
""",
"""
self.assertInHTML(
expected_notice,
response.text,
)
self.assertInHTML(
"""
expected_table = """
<thead>
<tr>
<th>Name</th>
<th>Party</th>
</tr>
</thead>
""",
"""
self.assertInHTML(
expected_table,
response.text,
)

Expand Down

0 comments on commit 35991c3

Please sign in to comment.