Sfoglia il codice sorgente

Make use of tags instead of function

Denis K 8 anni fa
parent
commit
fd932c948a
2 ha cambiato i file con 3 aggiunte e 4 eliminazioni
  1. 0 1
      jet/templatetags/jet_tags.py
  2. 3 3
      jet/tests/test_tags.py

+ 0 - 1
jet/templatetags/jet_tags.py

@@ -316,7 +316,6 @@ def jet_change_form_sibling_links_enabled():
     return settings.JET_CHANGE_FORM_SIBLING_LINKS
 
 
-@register.simple_tag(takes_context=True)
 def jet_sibling_object_url(context, next):
     original = context.get('original')
 

+ 3 - 3
jet/tests/test_tags.py

@@ -1,7 +1,7 @@
 from django import forms
 from django.core.urlresolvers import reverse
 from django.test import TestCase
-from jet.templatetags.jet_tags import select2_lookups, jet_sibling_object_url
+from jet.templatetags.jet_tags import select2_lookups, jet_next_object_url, jet_previous_object_url
 from jet.tests.models import TestModel, SearchableTestModel
 
 
@@ -66,7 +66,7 @@ class TagsTestCase(TestCase):
             'preserved_filters': preserved_filters
         }
 
-        actual_url = jet_sibling_object_url(context, next=True)
+        actual_url = jet_next_object_url(context)
         expected_url = reverse('admin:%s_%s_change' % (
             TestModel._meta.app_label,
             TestModel._meta.model_name
@@ -84,7 +84,7 @@ class TagsTestCase(TestCase):
             'preserved_filters': preserved_filters
         }
 
-        actual_url = jet_sibling_object_url(context, next=False)
+        actual_url = jet_previous_object_url(context)
         expected_url = None
 
         self.assertEqual(actual_url, expected_url)