Browse Source

fix #596: removed misago_patinator utility

Rafał Pitoń 8 years ago
parent
commit
5cfbd40608

+ 0 - 30
misago/core/templatetags/misago_pagination.py

@@ -1,30 +0,0 @@
-from django import template
-from django.template.loader import get_template
-from django.urls import reverse
-
-
-register = template.Library()
-
-
-@register.simple_tag
-def pagination(page, template, link_name, **kwargs):
-    template = get_template(template)
-
-    context = kwargs
-    context.update({
-        'paginator': page.paginator,
-        'page': page,
-        'link_name': link_name,
-    })
-
-    return template.render(context)
-
-
-@register.simple_tag
-def pageurl(link, kwargs, page=None):
-    if page > 1:
-        kwargs['page'] = page
-    else:
-        kwargs.pop('page', None)
-
-    return reverse(link, kwargs=kwargs)

+ 0 - 20
misago/core/tests/test_templatetags.py

@@ -163,26 +163,6 @@ class MockUser(object):
     slug = "bob"
 
 
-class PaginationTests(TestCase):
-    def setUp(self):
-        self.page = paginate(range(500), 11, 20, 5)
-        self.context = Context({
-            'page': self.page,
-            'user': MockUser()
-        })
-
-    def _test_pagination(self):
-        """capture content to variable"""
-        tpl_content = """
-{% load misago_pagination %}
-
-{% pagination page "misago/user/pagination.html" 'misago:user_warnings' slug=user.slug pk=user.pk %}
-"""
-
-        tpl = Template(tpl_content)
-        tpl.render(self.context).strip()
-
-
 class ShorthandsTests(TestCase):
     def test_iftrue_for_true(self):
         """iftrue renders value for true"""