Ticket #6271: regroup_regression_test.diff
File regroup_regression_test.diff, 2.2 KB (added by , 17 years ago) |
---|
-
tests/regressiontests/templates/tests.py
807 807 '{% endfor %},' + \ 808 808 '{% endfor %}', 809 809 {}, ''), 810 811 # Test for regroup with filter on the "by" argument 812 'regroup03': ('{% regroup data by bar|date:"F Y" as grouped %}' + \ 813 '{% for group in grouped %}' + \ 814 '{{ group.grouper }}:' + \ 815 '{% for item in group.list %}' + \ 816 '{{ item.foo }}' + \ 817 '{% endfor %},' + \ 818 '{% endfor %}', 819 {'data': [ {'foo':'c', 'bar':datetime(2000,1,1)}, 820 {'foo':'d', 'bar':datetime(2000,1,1)}, 821 {'foo':'a', 'bar':datetime(2000,2,1)}, 822 {'foo':'b', 'bar':datetime(2000,2,1)}, 823 {'foo':'x', 'bar':datetime(2000,3,1)} ]}, 824 'Jan 2000:cd,Feb 2000:ab,Mar 2000:x,'), 810 825 811 826 # Test syntax. 812 'regroup0 3': ('{% regroup data by bar as %}', {},827 'regroup04': ('{% regroup data by bar as %}', {}, 813 828 template.TemplateSyntaxError), 814 'regroup0 4': ('{% regroup data by bar thisaintright grouped %}', {},829 'regroup05': ('{% regroup data by bar thisaintright grouped %}', {}, 815 830 template.TemplateSyntaxError), 816 'regroup0 5': ('{% regroup data thisaintright bar as grouped %}', {},831 'regroup06': ('{% regroup data thisaintright bar as grouped %}', {}, 817 832 template.TemplateSyntaxError), 818 'regroup0 6': ('{% regroup data by bar as grouped toomanyargs %}', {},833 'regroup07': ('{% regroup data by bar as grouped toomanyargs %}', {}, 819 834 template.TemplateSyntaxError), 820 835 821 836 ### TEMPLATETAG TAG #######################################################