Ticket #16676: 16676.patch
File 16676.patch, 1.5 KB (added by , 13 years ago) |
---|
-
django/template/defaultfilters.py
664 664 except (ValueError, TypeError): 665 665 try: 666 666 return value + arg 667 except :668 return value667 except Exception: 668 return '' 669 669 add.is_safe = False 670 670 671 671 def get_digit(value, arg): -
tests/regressiontests/templates/filters.py
346 346 #Ticket 9520: Make sure |date doesn't blow up on non-dates 347 347 'date03': (r'{{ d|date:"m" }}', {'d': 'fail_string'}, ''), 348 348 349 # Tests for #11687 349 # Tests for #11687 and #16676 350 350 'add01': (r'{{ i|add:"5" }}', {'i': 2000}, '2005'), 351 'add02': (r'{{ i|add:"napis" }}', {'i': 2000}, ' 2000'),352 'add03': (r'{{ i|add:16 }}', {'i': 'not_an_int'}, ' not_an_int'),351 'add02': (r'{{ i|add:"napis" }}', {'i': 2000}, ''), 352 'add03': (r'{{ i|add:16 }}', {'i': 'not_an_int'}, ''), 353 353 'add04': (r'{{ i|add:"16" }}', {'i': 'not_an_int'}, 'not_an_int16'), 354 354 'add05': (r'{{ l1|add:l2 }}', {'l1': [1, 2], 'l2': [3, 4]}, '[1, 2, 3, 4]'), 355 355 'add06': (r'{{ t1|add:t2 }}', {'t1': (3, 4), 't2': (1, 2)}, '(3, 4, 1, 2)'),