diff --git a/bookwyrm/templatetags/bookwyrm_tags.py b/bookwyrm/templatetags/bookwyrm_tags.py index eda3d102..caab30a8 100644 --- a/bookwyrm/templatetags/bookwyrm_tags.py +++ b/bookwyrm/templatetags/bookwyrm_tags.py @@ -11,12 +11,6 @@ from bookwyrm.views.status import to_markdown register = template.Library() -@register.filter(name="dict_key") -def dict_key(d, k): - """Returns the given key from a dictionary.""" - return d.get(k) or 0 - - @register.filter(name="rating") def get_rating(book, user): """get the overall rating of a book""" diff --git a/bookwyrm/tests/test_templatetags.py b/bookwyrm/tests/test_templatetags.py index a92e887a..1c05e992 100644 --- a/bookwyrm/tests/test_templatetags.py +++ b/bookwyrm/tests/test_templatetags.py @@ -2,7 +2,6 @@ import re from unittest.mock import patch -from dateutil.relativedelta import relativedelta from django.test import TestCase from django.utils import timezone @@ -33,12 +32,6 @@ class TemplateTags(TestCase): ) self.book = models.Edition.objects.create(title="Test Book") - def test_dict_key(self, _): - """just getting a value out of a dict""" - test_dict = {"a": 1, "b": 3} - self.assertEqual(bookwyrm_tags.dict_key(test_dict, "a"), 1) - self.assertEqual(bookwyrm_tags.dict_key(test_dict, "c"), 0) - def test_get_user_rating(self, _): """get a user's most recent rating of a book""" with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"):