diff options
| author | Karen Tracey <kmtracey@gmail.com> | 2008-10-28 19:04:59 +0000 |
|---|---|---|
| committer | Karen Tracey <kmtracey@gmail.com> | 2008-10-28 19:04:59 +0000 |
| commit | 84216ef05e6099235559a9a018bf4e0ad6ecff70 (patch) | |
| tree | 0224fd785d48e76b398bc8bce0d7c9162686df24 /tests | |
| parent | a8a07c20572a97185812a0dd5f8dea491a4dcfee (diff) | |
[1.0.X] Fixed #8966 -- Changed is_safe for length_is filter to False, since its return value is a boolean, not a string.
Thanks Thomas Steinacher, carljm, and SmileyChris.
Backport of r9291 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9292 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/templates/filters.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/regressiontests/templates/filters.py b/tests/regressiontests/templates/filters.py index bee568698c..d69a885822 100644 --- a/tests/regressiontests/templates/filters.py +++ b/tests/regressiontests/templates/filters.py @@ -277,5 +277,9 @@ def get_filter_tests(): 'escapejs01': (r'{{ a|escapejs }}', {'a': 'testing\r\njavascript \'string" <b>escaping</b>'}, 'testing\\x0D\\x0Ajavascript \\x27string\\x22 \\x3Cb\\x3Eescaping\\x3C/b\\x3E'), 'escapejs02': (r'{% autoescape off %}{{ a|escapejs }}{% endautoescape %}', {'a': 'testing\r\njavascript \'string" <b>escaping</b>'}, 'testing\\x0D\\x0Ajavascript \\x27string\\x22 \\x3Cb\\x3Eescaping\\x3C/b\\x3E'), + + # Boolean return value from length_is should not be coerced to a string + 'lengthis01': (r'{% if "X"|length_is:0 %}Length is 0{% else %}Length not 0{% endif %}', {}, 'Length not 0'), + 'lengthis02': (r'{% if "X"|length_is:1 %}Length is 1{% else %}Length not 1{% endif %}', {}, 'Length is 1'), } |
