1
0
mirror of https://github.com/django/django.git synced 2024-12-23 17:46:27 +00:00
django/tests/regressiontests/templates/custom.py
Malcolm Tredinnick 2c6c60cec6 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
2009-03-25 03:45:56 +00:00

12 lines
244 B
Python

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"
"""