mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-28 19:10:35 +00:00
Removes unused templatetag
This commit is contained in:
parent
04cc2fb3f3
commit
3de8ae00ae
2 changed files with 0 additions and 19 deletions
|
@ -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"""
|
||||
|
|
|
@ -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"):
|
||||
|
|
Loading…
Reference in a new issue