summaryrefslogtreecommitdiff
path: root/tests/regressiontests/templates/custom.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-03-25 03:45:56 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-03-25 03:45:56 +0000
commit2c6c60cec613246bff5cb0be831969c20417b53c (patch)
tree01d35083c3c84236cd460b83512b432a794eef5c /tests/regressiontests/templates/custom.py
parent7f63d0009f762c6ce1c665df3674be2fcd3ef7fa (diff)
Template filters now pass numerical arguments through as numbers.
This was the (undocumented) behaviour prior to r10118 and now it's back again. It's neither hard nor harmful to maintain compatibility with the old ways. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10169 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/templates/custom.py')
-rw-r--r--tests/regressiontests/templates/custom.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/regressiontests/templates/custom.py b/tests/regressiontests/templates/custom.py
new file mode 100644
index 0000000000..e83b7dc736
--- /dev/null
+++ b/tests/regressiontests/templates/custom.py
@@ -0,0 +1,11 @@
+from django import test
+from django import template
+
+
+custom_filters = """
+>>> t = template.Template("{% load custom %}{{ string|trim:5 }}")
+>>> ctxt = template.Context({"string": "abcdefghijklmnopqrstuvwxyz"})
+>>> t.render(ctxt)
+u"abcde"
+"""
+