Skip to content

Commit

Permalink
Added a test to ensure the Django filter builtins are properly loaded…
Browse files Browse the repository at this point in the history
… into Jinja.
  • Loading branch information
miracle2k committed Aug 2, 2010
1 parent 7cf94a7 commit 3663541
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_defaultfilters.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ def r(s, context={}):
return env.from_string(s).render(context)


def test_django_builtins_available():
"""Many filters have not been re-implemented specifically for
Coffin, but instead the Django version is used through an
interop-layer.
Make sure that those are properly made available in Jinja2.
"""
from coffin.template import defaultfilters
assert not hasattr(defaultfilters, 'get_digit') # has no port
assert r('{{ "23475"|get_digit("2") }}') == '7'


def test_url():
# project name is optional
assert r('{{ "urls_app.views.index"|url() }}') == '/url_test/'
Expand Down

0 comments on commit 3663541

Please sign in to comment.