From 3de8ae00aed608c656e888875a570ef0b6cea4ab Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 11 May 2021 14:00:23 -0700 Subject: [PATCH] Removes unused templatetag --- bookwyrm/templatetags/bookwyrm_tags.py | 6 ------ bookwyrm/tests/test_templatetags.py | 13 ------------- 2 files changed, 19 deletions(-) diff --git a/bookwyrm/templatetags/bookwyrm_tags.py b/bookwyrm/templatetags/bookwyrm_tags.py index caab30a8..fa2998e6 100644 --- a/bookwyrm/templatetags/bookwyrm_tags.py +++ b/bookwyrm/templatetags/bookwyrm_tags.py @@ -43,12 +43,6 @@ def get_user_identifier(user): return user.localname if user.localname else user.username -@register.filter(name="notification_count") -def get_notification_count(user): - """how many UNREAD notifications are there""" - return user.notification_set.filter(read=False).count() - - @register.filter(name="replies") def get_replies(status): """get all direct replies to a status""" diff --git a/bookwyrm/tests/test_templatetags.py b/bookwyrm/tests/test_templatetags.py index 1c05e992..df4df671 100644 --- a/bookwyrm/tests/test_templatetags.py +++ b/bookwyrm/tests/test_templatetags.py @@ -53,19 +53,6 @@ class TemplateTags(TestCase): bookwyrm_tags.get_user_identifier(self.remote_user), "rat@example.com" ) - def test_get_notification_count(self, _): - """just countin'""" - self.assertEqual(bookwyrm_tags.get_notification_count(self.user), 0) - - models.Notification.objects.create(user=self.user, notification_type="FAVORITE") - models.Notification.objects.create(user=self.user, notification_type="MENTION") - - models.Notification.objects.create( - user=self.remote_user, notification_type="FOLLOW" - ) - - self.assertEqual(bookwyrm_tags.get_notification_count(self.user), 2) - def test_get_replies(self, _): """direct replies to a status""" with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"):