tests.txt
This file
Path
docs/src/tests.txt
30 lines · 773 bytes
Last changed by
[svn] added block shortcut syntax for jinjaArmin Ronacherbefore adoption4965987
History of this fileTake it
The walk stopped after 200 commits: lines older than 859efe0 point at it.
[svn] added ugly, ugly, ugly even more ugly but working hack to jinja to patch the template sources into linecache in order to support broken traceback formatters which go unnamed.Armin Ronacherbefore adoption859efe0
lines 1–28why, one step back1==============2Test Functions3==============45In addition to filters, Jinja also supports test functions. Test functions6always return either ``True`` or ``False``. Inside the template they are available7using the `is` operator.89Jinja comes with some builtin tests listed in the `designer documentation`_.1011Writing Test Functions12======================1314Test functions look exactly like filters mentioned in the `filter documentation`_:1516.. sourcecode:: python1718 def is_even():19 def wrapped(env, context, value):20 return value % 2 == 021 return wrapped2223Now you have to register that test on an environment:2425.. sourcecode:: python2627 env.tests['even'] = is_even28[svn] added block shortcut syntax for jinjaArmin Ronacherbefore adoption4965987
line 29why, one step back29.. _designer documentation: builtins.txt[svn] added ugly, ugly, ugly even more ugly but working hack to jinja to patch the template sources into linecache in order to support broken traceback formatters which go unnamed.Armin Ronacherbefore adoption859efe0
line 30why, one step back30.. _filter documentation: filters.txt