summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2012-08-11 19:15:50 -0400
committerKaren Tracey <kmtracey@gmail.com>2012-08-11 19:24:18 -0400
commit759ae3c2dafe149485a15d9a3bc97527c1ac1163 (patch)
treec900cf81e318816e053bcf373916c747ad98fb8f /tests
parent15fffcc7510ec2bf0fafdc254206619a8ab0923f (diff)
Fixed #18739 -- witdthratio behavior on None args
Made behavior given None consistent with how non-numerics were handled. Thanks to ja.geb@me.com for the report.
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/templates/tests.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index edbb21b6bd..a21b7ff323 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -1466,6 +1466,14 @@ class Templates(unittest.TestCase):
# #10043: widthratio should allow max_width to be a variable
'widthratio11': ('{% widthratio a b c %}', {'a':50,'b':100, 'c': 100}, '50'),
+ # #18739: widthratio should handle None args consistently with non-numerics
+ 'widthratio12a': ('{% widthratio a b c %}', {'a':'a','b':100,'c':100}, ''),
+ 'widthratio12b': ('{% widthratio a b c %}', {'a':None,'b':100,'c':100}, ''),
+ 'widthratio13a': ('{% widthratio a b c %}', {'a':0,'b':'b','c':100}, ''),
+ 'widthratio13b': ('{% widthratio a b c %}', {'a':0,'b':None,'c':100}, ''),
+ 'widthratio14a': ('{% widthratio a b c %}', {'a':0,'b':100,'c':'c'}, template.TemplateSyntaxError),
+ 'widthratio14b': ('{% widthratio a b c %}', {'a':0,'b':100,'c':None}, 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'),