|
@@ -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'),
|