# Ticket #6271: regroup_regression_test.diff

File regroup_regression_test.diff, 2.2 KB (added by Rob Hudson <treborhudson@…>, 15 years ago)

A test case for regroup with filters containing a space

• ## tests/regressiontests/templates/tests.py

 '{% endfor %},' + \ '{% endfor %}', {}, ''), # Test for regroup with filter on the "by" argument 'regroup03': ('{% regroup data by bar|date:"F Y" as grouped %}' + \ '{% for group in grouped %}' + \ '{{ group.grouper }}:' + \ '{% for item in group.list %}' + \ '{{ item.foo }}' + \ '{% endfor %},' + \ '{% endfor %}', {'data': [ {'foo':'c', 'bar':datetime(2000,1,1)}, {'foo':'d', 'bar':datetime(2000,1,1)}, {'foo':'a', 'bar':datetime(2000,2,1)}, {'foo':'b', 'bar':datetime(2000,2,1)}, {'foo':'x', 'bar':datetime(2000,3,1)} ]}, 'Jan 2000:cd,Feb 2000:ab,Mar 2000:x,'), # Test syntax. 'regroup03': ('{% regroup data by bar as %}', {}, 'regroup04': ('{% regroup data by bar as %}', {}, template.TemplateSyntaxError), 'regroup04': ('{% regroup data by bar thisaintright grouped %}', {}, 'regroup05': ('{% regroup data by bar thisaintright grouped %}', {}, template.TemplateSyntaxError), 'regroup05': ('{% regroup data thisaintright bar as grouped %}', {}, 'regroup06': ('{% regroup data thisaintright bar as grouped %}', {}, template.TemplateSyntaxError), 'regroup06': ('{% regroup data by bar as grouped toomanyargs %}', {}, 'regroup07': ('{% regroup data by bar as grouped toomanyargs %}', {}, template.TemplateSyntaxError), ### TEMPLATETAG TAG #######################################################