From 9dd65fde30af6adf4be7ceb1b55bdc50ce56b6ee Mon Sep 17 00:00:00 2001 From: vincent porte Date: Tue, 3 Dec 2024 11:27:23 +0100 Subject: [PATCH] update upvote icon --- .../tests/__snapshots__/tests_views.ambr | 40 +++++++++---------- .../forum_conversation/tests/tests_views.py | 4 +- .../tests/tests_views_htmx.py | 6 +-- .../tests/test_forumupvoteview.py | 8 +++- .../forum_upvote/tests/test_postupvoteview.py | 8 +++- lacommunaute/templates/partials/upvotes.html | 6 +-- 6 files changed, 40 insertions(+), 32 deletions(-) diff --git a/lacommunaute/forum/tests/__snapshots__/tests_views.ambr b/lacommunaute/forum/tests/__snapshots__/tests_views.ambr index 18b4e423e..e96320d62 100644 --- a/lacommunaute/forum/tests/__snapshots__/tests_views.ambr +++ b/lacommunaute/forum/tests/__snapshots__/tests_views.ambr @@ -327,8 +327,8 @@
- - 0 + + 0 @@ -486,8 +486,8 @@
- - 0 + + 0 @@ -499,8 +499,8 @@
- - 0 + + 0 @@ -514,8 +514,8 @@
-
@@ -528,8 +528,8 @@
- - 1 + + 1 @@ -541,8 +541,8 @@
- - 1 + + 1 @@ -556,8 +556,8 @@
-
@@ -570,8 +570,8 @@
- - 2 + + 2 @@ -583,8 +583,8 @@
- - 2 + + 2 @@ -598,8 +598,8 @@
-
diff --git a/lacommunaute/forum_conversation/tests/tests_views.py b/lacommunaute/forum_conversation/tests/tests_views.py index 96f1d27eb..5fbac642e 100644 --- a/lacommunaute/forum_conversation/tests/tests_views.py +++ b/lacommunaute/forum_conversation/tests/tests_views.py @@ -663,7 +663,7 @@ def test_post_has_no_upvote(self): response = self.client.get(self.url) self.assertContains( - response, '0', status_code=200 + response, '0', status_code=200 ) def test_post_has_upvote_by_user(self): @@ -673,7 +673,7 @@ def test_post_has_upvote_by_user(self): response = self.client.get(self.url) self.assertContains( - response, '1', status_code=200 + response, '1', status_code=200 ) def test_certified_post_is_highlighted(self): diff --git a/lacommunaute/forum_conversation/tests/tests_views_htmx.py b/lacommunaute/forum_conversation/tests/tests_views_htmx.py index 83df2f0c9..ac87dd15c 100644 --- a/lacommunaute/forum_conversation/tests/tests_views_htmx.py +++ b/lacommunaute/forum_conversation/tests/tests_views_htmx.py @@ -189,7 +189,7 @@ def test_upvote_annotations(self): response = view.get(request) self.assertContains( - response, '0', status_code=200 + response, '0', status_code=200 ) UpVoteFactory(content_object=post, voter=UserFactory()) @@ -197,7 +197,7 @@ def test_upvote_annotations(self): response = view.get(request) self.assertContains( - response, '2', status_code=200 + response, '2', status_code=200 ) def test_certified_post_highlight(self): @@ -287,7 +287,7 @@ def test_create_post_as_authenticated_user(self, *args): self.assertContains(response, self.content, status_code=200) self.assertIsInstance(response.context["form"], PostForm) self.assertEqual(1, ForumReadTrack.objects.count()) - self.assertContains(response, '0') + self.assertContains(response, '0') self.topic.refresh_from_db() self.assertEqual(self.topic.posts.count(), 2) self.assertEqual( diff --git a/lacommunaute/forum_upvote/tests/test_forumupvoteview.py b/lacommunaute/forum_upvote/tests/test_forumupvoteview.py index 227274df4..51516fbfb 100644 --- a/lacommunaute/forum_upvote/tests/test_forumupvoteview.py +++ b/lacommunaute/forum_upvote/tests/test_forumupvoteview.py @@ -32,12 +32,16 @@ def test_upvote_downvote_with_permission(client, db): # upvote response = client.post(url, data=form_data) - assertContains(response, '1', status_code=200) + assertContains( + response, '1', status_code=200 + ) assert UpVote.objects.get() # downvote response = client.post(url, data=form_data) - assertContains(response, '0', status_code=200) + assertContains( + response, '0', status_code=200 + ) assert not UpVote.objects.all() diff --git a/lacommunaute/forum_upvote/tests/test_postupvoteview.py b/lacommunaute/forum_upvote/tests/test_postupvoteview.py index ef7e98a24..836a98fec 100644 --- a/lacommunaute/forum_upvote/tests/test_postupvoteview.py +++ b/lacommunaute/forum_upvote/tests/test_postupvoteview.py @@ -34,7 +34,9 @@ def test_upvote_with_permission(client, db): # upvote response = client.post(url, data=form_data) - assertContains(response, '1', status_code=200) + assertContains( + response, '1', status_code=200 + ) assert UpVote.objects.get( voter_id=user.id, object_id=topic.first_post.id, @@ -43,7 +45,9 @@ def test_upvote_with_permission(client, db): # downvote response = client.post(url, data=form_data) - assertContains(response, '0', status_code=200) + assertContains( + response, '0', status_code=200 + ) assert not UpVote.objects.all() diff --git a/lacommunaute/templates/partials/upvotes.html b/lacommunaute/templates/partials/upvotes.html index edc4a2434..e9df639d8 100644 --- a/lacommunaute/templates/partials/upvotes.html +++ b/lacommunaute/templates/partials/upvotes.html @@ -9,7 +9,7 @@ hx-swap="outerHTML"> {% else %} @@ -18,8 +18,8 @@ class="btn btn-sm btn-ico btn-link btn-secondary px-2" data-bs-toggle="tooltip" data-bs-placement="top" - title="Connectez-vous pour sauvegarder"> - {{ counter }} + title="Connectez-vous pour vous abonner à ce contenu"> + {{ counter }} {% endif %} {% endwith %}