Skip to content

Commit

Permalink
Merge pull request #25 from DemocracyClub/hotfix/ni-postal-vote-deadline
Browse files Browse the repository at this point in the history
Change NI to 14 day postal vote reg deadline
  • Loading branch information
Bekabyx authored Jul 25, 2023
2 parents 20dc5b0 + 858bcc3 commit ee24330
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/elections/test_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,12 @@ def test_postal_vote_application_deadline_local_election_england():
election = LocalElection(date(2021, 5, 6), country=Country.ENGLAND)

assert election.postal_vote_application_deadline == date(2021, 4, 20)


# Reference election: local.belfast.2023-05-18
def test_postal_vote_application_deadline_local_election_northern_ireland():
deadline = LocalElection(
date(2023, 5, 18), country=Country.NORTHERN_IRELAND
).postal_vote_application_deadline

assert deadline == date(2023, 4, 26)
5 changes: 5 additions & 0 deletions uk_election_timetables/election.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ def postal_vote_application_deadline(self) -> date:
This is set out in `The Representation of the People (England and Wales) Regulations 2001 <https://www.legislation.gov.uk/uksi/2001/341/regulation/56/made>`_.
In Northern Ireland, this is set out in `The Representation of the People (Northern Ireland) Regulations 2008 <https://www.legislation.gov.uk/uksi/2008/1741/regulation/61/made>`
:return: a datetime representing the postal vote application deadline
"""
if self.country == Country.NORTHERN_IRELAND:
return working_days_before(self.poll_date, 14, self._calendar())

return working_days_before(self.poll_date, 11, self._calendar())

@property
Expand Down

0 comments on commit ee24330

Please sign in to comment.