Skip to content

Commit

Permalink
fix(stats): more resilient tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Jun 6, 2024
1 parent 281d91d commit 3c9ede4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lacommunaute/forum_stats/tests/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def test_impact_in_context_data(self):
def test_navigation(self):
url = reverse("forum_stats:statistiques")
response = self.client.get(url)
self.assertContains(response, "<a href=/statistiques/monthly-visitors/>")
self.assertContains(response, f"<a href={reverse('forum_stats:monthly_visitors')}>")


class TestMonthlyVisitorsView:
Expand Down Expand Up @@ -162,4 +162,6 @@ def test_navigation(self, client, db):
url = reverse("forum_stats:monthly_visitors")
response = client.get(url)
assert response.status_code == 200
assertContains(response, '<a href="/statistiques/">retour vers la page statistiques</a>')
assertContains(
response, f'<a href="{reverse('forum_stats:statistiques')}">retour vers la page statistiques</a>'
)

0 comments on commit 3c9ede4

Please sign in to comment.