From ddec93ff82a05cd05cbd0861ceb6e9f07c474bed Mon Sep 17 00:00:00 2001 From: vincent porte Date: Mon, 24 Jul 2023 17:58:14 +0200 Subject: [PATCH] feat(forum_upvote): update icon and title for upvotes --- lacommunaute/forum_conversation/tests/tests_views.py | 4 ++-- .../forum_conversation/tests/tests_views_htmx.py | 6 +++--- .../forum_upvote/tests/test_forumupvoteview.py | 4 ++-- .../forum_upvote/tests/test_postupvoteview.py | 4 ++-- lacommunaute/templates/partials/upvotes.html | 11 +++++------ 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/lacommunaute/forum_conversation/tests/tests_views.py b/lacommunaute/forum_conversation/tests/tests_views.py index 1a962abb8..2f610a337 100644 --- a/lacommunaute/forum_conversation/tests/tests_views.py +++ b/lacommunaute/forum_conversation/tests/tests_views.py @@ -428,7 +428,7 @@ def test_post_has_no_upvote(self): response = self.client.get(self.url) self.assertEqual(response.status_code, 200) - self.assertContains(response, '0') + self.assertContains(response, '0') def test_post_has_upvote_by_user(self): PostFactory(topic=self.topic, poster=self.poster) @@ -437,7 +437,7 @@ def test_post_has_upvote_by_user(self): response = self.client.get(self.url) self.assertEqual(response.status_code, 200) - self.assertContains(response, '1') + self.assertContains(response, '1') def test_certified_post_is_highlighted(self): post = PostFactory(topic=self.topic, poster=self.poster) diff --git a/lacommunaute/forum_conversation/tests/tests_views_htmx.py b/lacommunaute/forum_conversation/tests/tests_views_htmx.py index daeba6da1..6a0a3779e 100644 --- a/lacommunaute/forum_conversation/tests/tests_views_htmx.py +++ b/lacommunaute/forum_conversation/tests/tests_views_htmx.py @@ -341,14 +341,14 @@ def test_upvote_annotations(self): response = view.get(request) self.assertEqual(response.status_code, 200) - self.assertContains(response, '0') + self.assertContains(response, '0') UpVoteFactory(content_object=post, voter=UserFactory()) UpVoteFactory(content_object=post, voter=self.user) response = view.get(request) self.assertEqual(response.status_code, 200) - self.assertContains(response, '2') + self.assertContains(response, '2') def test_certified_post_highlight(self): post = PostFactory(topic=self.topic, poster=self.user) @@ -430,7 +430,7 @@ def test_create_post_as_authenticated_user(self, *args): self.assertContains(response, self.content) 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 8f9c00a39..666e20c51 100644 --- a/lacommunaute/forum_upvote/tests/test_forumupvoteview.py +++ b/lacommunaute/forum_upvote/tests/test_forumupvoteview.py @@ -34,7 +34,7 @@ def test_upvote_downvote_with_permission(client, db): # upvote response = client.post(url, data=form_data) assert response.status_code == 200 - assert '1' in str(response.content) + assert '1' in str(response.content) assert UpVote.objects.get( voter_id=user.id, object_id=forum.id, content_type=ContentType.objects.get_for_model(forum) ) @@ -42,7 +42,7 @@ def test_upvote_downvote_with_permission(client, db): # downvote response = client.post(url, data=form_data) assert response.status_code == 200 - assert '0' in str(response.content) + assert '0' in str(response.content) assert not UpVote.objects.all() diff --git a/lacommunaute/forum_upvote/tests/test_postupvoteview.py b/lacommunaute/forum_upvote/tests/test_postupvoteview.py index 1e3546a37..119a524b3 100644 --- a/lacommunaute/forum_upvote/tests/test_postupvoteview.py +++ b/lacommunaute/forum_upvote/tests/test_postupvoteview.py @@ -35,7 +35,7 @@ def test_upvote_with_permission(client, db): # upvote response = client.post(url, data=form_data) assert response.status_code == 200 - assert '1' in str(response.content) + assert '1' in str(response.content) assert UpVote.objects.get( voter_id=user.id, object_id=topic.first_post.id, @@ -45,7 +45,7 @@ def test_upvote_with_permission(client, db): # downvote response = client.post(url, data=form_data) assert response.status_code == 200 - assert '0' in str(response.content) + assert '0' in str(response.content) assert not UpVote.objects.all() diff --git a/lacommunaute/templates/partials/upvotes.html b/lacommunaute/templates/partials/upvotes.html index 2e521175a..13ab74fd1 100644 --- a/lacommunaute/templates/partials/upvotes.html +++ b/lacommunaute/templates/partials/upvotes.html @@ -11,19 +11,18 @@ {% else %} - - {% trans "UpVotes" %} - {{counter}} + + {{counter}} {% endif %} {% endwith %}