From d16c49139f825027001a39ebb11be9f741b0dc17 Mon Sep 17 00:00:00 2001 From: vincent porte Date: Mon, 2 Oct 2023 17:26:23 +0200 Subject: [PATCH] fix test --- lacommunaute/pages/tests/tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lacommunaute/pages/tests/tests.py b/lacommunaute/pages/tests/tests.py index a106315ae..c3c82fd35 100644 --- a/lacommunaute/pages/tests/tests.py +++ b/lacommunaute/pages/tests/tests.py @@ -3,6 +3,7 @@ from django.test import TestCase from django.urls import reverse from django.utils import timezone +from django.utils.dateformat import format from django.utils.timezone import localdate from faker import Faker from machina.core.loading import get_class @@ -80,7 +81,7 @@ def test_month_datas_in_context(self): uniq_engaged_visitors = StatFactory(name="nb_uniq_engaged_visitors", period=Period.MONTH, date=today) response = self.client.get(url) self.assertEqual(response.status_code, 200) - self.assertEqual(response.context["period"], today.strftime("%B %Y")) + self.assertEqual(response.context["period"], format(today, "F Y")) self.assertEqual(response.context["nb_uniq_visitors"], uniq_visitors.value) self.assertEqual(response.context["nb_uniq_active_visitors"], uniq_active_visitors.value) self.assertEqual(response.context["nb_uniq_engaged_visitors"], uniq_engaged_visitors.value)