diff options
| author | Jonathan Slenders <jonathan@slenders.be> | 2013-08-14 16:14:32 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-08-14 12:40:19 -0400 |
| commit | ff410565bf1cf1a2905c1ef83db408d455211446 (patch) | |
| tree | 5f2ecee536c3a2ae1a9bea58d20ec537d669ee71 /tests | |
| parent | 71c491972eecae8783cf46e69fac7e5f9f83fc59 (diff) | |
Fixed #20709 -- Allowed {% widthratio %} to accept an "as" parameter.
Thanks clay.evil@ for the suggestion.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/template_tests/tests.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/template_tests/tests.py b/tests/template_tests/tests.py index aa0283be79..034280f08d 100644 --- a/tests/template_tests/tests.py +++ b/tests/template_tests/tests.py @@ -1575,6 +1575,13 @@ class TemplateTests(TransRealMixin, TestCase): # Test whitespace in filter argument 'widthratio15': ('{% load custom %}{% widthratio a|noop:"x y" b 0 %}', {'a':50,'b':100}, '0'), + # Widthratio with variable assignment + 'widthratio16': ('{% widthratio a b 100 as variable %}-{{ variable }}-', {'a':50,'b':100}, '-50-'), + 'widthratio17': ('{% widthratio a b 100 as variable %}-{{ variable }}-', {'a':100,'b':100}, '-100-'), + + 'widthratio18': ('{% widthratio a b 100 as %}', { }, template.TemplateSyntaxError), + 'widthratio19': ('{% widthratio a b 100 not_as variable %}', { }, template.TemplateSyntaxError), + ### WITH TAG ######################################################## 'with01': ('{% with key=dict.key %}{{ key }}{% endwith %}', {'dict': {'key': 50}}, '50'), 'legacywith01': ('{% with dict.key as key %}{{ key }}{% endwith %}', {'dict': {'key': 50}}, '50'), |
