diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2011-10-30 07:32:21 +0000 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2011-10-30 07:32:21 +0000 |
| commit | d17bc72880caea967ee1f4332941269837b68a2a (patch) | |
| tree | fc1fa3537f139a2f2f1829c7bbdff008fdbc684a /tests | |
| parent | bebbc9e4a537f45bfd24a902d223ad96d743a524 (diff) | |
Fixed #17135 -- Made it possible to use decorators (like stringfilter) on template filter functions in combination with auto-escaping. Refs #16726.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17056 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/templates/templatetags/custom.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/regressiontests/templates/templatetags/custom.py b/tests/regressiontests/templates/templatetags/custom.py index 86206617b8..7f788311c6 100644 --- a/tests/regressiontests/templates/templatetags/custom.py +++ b/tests/regressiontests/templates/templatetags/custom.py @@ -6,11 +6,10 @@ from django.template.loader import get_template register = template.Library() +@register.filter +@stringfilter def trim(value, num): return value[:num] -trim = stringfilter(trim) - -register.filter(trim) @register.simple_tag def no_params(): @@ -303,4 +302,4 @@ assignment_unlimited_args_kwargs.anything = "Expected assignment_unlimited_args_ 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__"
\ No newline at end of file +assignment_tag_without_context_parameter.anything = "Expected assignment_tag_without_context_parameter __dict__" |
