summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-11-07 18:19:34 -0500
committerTim Graham <timograham@gmail.com>2017-01-17 14:09:28 -0500
commitf032bbc8b107ab9274542f8d233fc88aa1c6e04d (patch)
tree4113c993f2d0018bfd3cc23d656a2ecd981d5149 /tests
parent742d666da57b52a3b00aa9b1c527ece829e95245 (diff)
Refs #18651 -- Removed assignment_tag per deprecation timeline.
Diffstat (limited to 'tests')
-rw-r--r--tests/template_tests/templatetags/custom.py17
-rw-r--r--tests/template_tests/test_custom.py23
2 files changed, 0 insertions, 40 deletions
diff --git a/tests/template_tests/templatetags/custom.py b/tests/template_tests/templatetags/custom.py
index fffef022ac..3c3e4ce8ed 100644
--- a/tests/template_tests/templatetags/custom.py
+++ b/tests/template_tests/templatetags/custom.py
@@ -1,5 +1,4 @@
import operator
-import warnings
from django import template
from django.template.defaultfilters import stringfilter
@@ -168,19 +167,3 @@ def minustwo_overridden_name(value):
register.simple_tag(lambda x: x - 1, name='minusone')
-
-
-with warnings.catch_warnings():
- warnings.simplefilter('ignore')
-
- @register.assignment_tag
- def assignment_no_params():
- """Expected assignment_no_params __doc__"""
- return "assignment_no_params - Expected result"
- assignment_no_params.anything = "Expected assignment_no_params __dict__"
-
- @register.assignment_tag(takes_context=True)
- def assignment_tag_without_context_parameter(arg):
- """Expected assignment_tag_without_context_parameter __doc__"""
- return "Expected result"
- assignment_tag_without_context_parameter.anything = "Expected assignment_tag_without_context_parameter __dict__"
diff --git a/tests/template_tests/test_custom.py b/tests/template_tests/test_custom.py
index e6a876086e..b63882a9a8 100644
--- a/tests/template_tests/test_custom.py
+++ b/tests/template_tests/test_custom.py
@@ -306,29 +306,6 @@ class InclusionTagTests(TagTestCase):
self.assertEqual(template.render(Context({})).strip(), 'one\ntwo')
-class AssignmentTagTests(TagTestCase):
-
- def test_assignment_tags(self):
- c = Context({'value': 42})
-
- t = self.engine.from_string('{% load custom %}{% assignment_no_params as var %}The result is: {{ var }}')
- self.assertEqual(t.render(c), 'The result is: assignment_no_params - Expected result')
-
- def test_assignment_tag_registration(self):
- # The decorators preserve the decorated function's docstring, name,
- # and attributes.
- self.verify_tag(custom.assignment_no_params, 'assignment_no_params')
-
- def test_assignment_tag_missing_context(self):
- # The 'context' parameter must be present when takes_context is True
- msg = (
- "'assignment_tag_without_context_parameter' is decorated with "
- "takes_context=True so it must have a first argument of 'context'"
- )
- with self.assertRaisesMessage(TemplateSyntaxError, msg):
- self.engine.from_string('{% load custom %}{% assignment_tag_without_context_parameter 123 as var %}')
-
-
class TemplateTagLoadingTests(SimpleTestCase):
@classmethod