From eda25f6db13a7f5db0b48dc39427d6be568b8926 Mon Sep 17 00:00:00 2001 From: Sym Roe Date: Mon, 11 Sep 2023 19:57:38 +0100 Subject: [PATCH] Fix failing test with date_in_near_future hard coded --- ynr/apps/elections/tests/test_ballot_view.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ynr/apps/elections/tests/test_ballot_view.py b/ynr/apps/elections/tests/test_ballot_view.py index a3f967972..e08c0bd2e 100644 --- a/ynr/apps/elections/tests/test_ballot_view.py +++ b/ynr/apps/elections/tests/test_ballot_view.py @@ -11,6 +11,7 @@ OrganizationFactory, PostFactory, ) +from django.template.defaultfilters import date from django.utils.html import escape from django_webtest import WebTest from elections.filters import ( @@ -130,8 +131,9 @@ def test_ballot_with_candidates_no_sopn(self): self.assertEqual(response.context["candidates"].count(), 9) self.assertDataTimelineCandidateAddingInProgress(response) + self.assertInHTML( - "

Candidates for Bar Ward on
7 September 2023

", + f"

Candidates for Bar Ward on
{date(date_in_near_future, 'j F Y')}

", response.text, ) self.assertInHTML(