Index: tests/regressiontests/templates/tests.py
===================================================================
--- tests/regressiontests/templates/tests.py	(revision 7884)
+++ tests/regressiontests/templates/tests.py	(working copy)
@@ -17,6 +17,7 @@
 from django.utils.safestring import mark_safe
 from django.utils.tzinfo import LocalTimezone
 
+#from decorators import DecoratorsTest
 from unicode import unicode_tests
 from context import context_tests
 
@@ -407,6 +408,11 @@
             'cycle13': ("{% for i in test %}{% cycle 'a' 'b' %}{{ i }},{% endfor %}", {'test': range(5)}, 'a0,b1,a2,b3,a4,'),
             'cycle14': ("{% cycle one two as foo %}{% cycle foo %}", {'one': '1','two': '2'}, '12'),
             'cycle13': ("{% for i in test %}{% cycle aye bee %}{{ i }},{% endfor %}", {'test': range(5), 'aye': 'a', 'bee': 'b'}, 'a0,b1,a2,b3,a4,'),
+            
+            ### EMPTY STRINGS #########################################################
+            'emptystring01': ("{{ '' }}", {}, ""),
+            'emptystring02': ("{% ifequal foo '' %}x{% endifequal %}", {'foo': ''}, 'x'),
+            'emptystring03': ("{% ifequal foo|default:'' foo %}x{% endifequal %}", {'foo': ''}, 'x'),
 
             ### EXCEPTIONS ############################################################
 
@@ -576,6 +582,13 @@
             'ifequal08': ('{% ifequal a "test" %}yes{% else %}no{% endifequal %}', {"a": "no"}, "no"),
             'ifequal09': ('{% ifequal a "test" %}yes{% else %}no{% endifequal %}', {}, "no"),
             'ifequal10': ('{% ifequal a b %}yes{% else %}no{% endifequal %}', {}, "yes"),
+            
+            ## FILTER EXPRESSIONS AS ARGUMENTS ########################################
+            'ifequal-filter01': ('{% ifequal a|upper "A" %}x{% endifequal %}', {'a': 'a'}, 'x'),
+            'ifequal-filter02': ('{% ifequal "A" a|upper %}x{% endifequal %}', {'a': 'a'}, 'x'),
+            'ifequal-filter03': ('{% ifequal a|upper b|upper %}x{% endifequal %}', {'a': 'x', 'b': 'X'}, 'x'),
+            'ifequal-filter04': ('{% ifequal x|slice:"1" "a" %}x{% endifequal %}', {'x': 'aaa'}, 'x'),
+            'ifequal-filter05': ('{% ifequal x|slice:"1"|upper "A" %}x{% endifequal %}', {'x': 'aaa'}, 'x'),
 
             # SMART SPLITTING
             'ifequal-split01': ('{% ifequal a "test man" %}yes{% else %}no{% endifequal %}', {}, "no"),
@@ -614,6 +627,26 @@
             'include02': ('{% include "basic-syntax02" %}', {'headline': 'Included'}, "Included"),
             'include03': ('{% include template_name %}', {'template_name': 'basic-syntax02', 'headline': 'Included'}, "Included"),
             'include04': ('a{% include "nonexistent" %}b', {}, "ab"),
+            'include-with01': ('{% include "basic-syntax02" with foo as headline %}', {'foo': 'Included'}, "Included"),
+            'include-with02': ('{% include "basic-syntax03" with foo as first, bar as second %}', {"foo" : 1, "bar" : 2}, "1 --- 2"),
+            'recursive-include': ('{% for item in items %}{{ item.label }}{% if not item.children|length_is:0 %}{% with item.children as items %}({% include "recursive-include" %}){% endwith %}{% endif %}{% endfor %}', {
+                'items': [
+                    {'label': 1, 'children': [
+                        {'label': 2, 'children': [
+                            {'label': 3, 'children': []},
+                            {'label': 4, 'children': []},
+                        ]},
+                        {'label': 5, 'children': [
+                             {'label': 6, 'children': [
+                                 {'label': 7, 'children': [
+                                     {'label': 8, 'children': []},	
+                                 ]},
+                                {'label': 9, 'children': []},	
+                             ]},
+                        ]},
+                    ]},
+                ],
+            }, '1(2(34)5(6(7(8)9)))'),
 
             ### NAMED ENDBLOCKS #######################################################
 
@@ -796,6 +829,12 @@
                             you
                             gentlemen.
                             """),
+            ### NEGATIVE NUMERIC LITERALS #############################################                            
+            'negative-numeric-literal01': ('{{ -1 }}', {}, '-1'),
+            'negative-numeric-literal02': ('{{ -2.01 }}', {}, '-2.01'),
+            'negative-numeric-literal03': ('{{ -0.1 }}', {}, '-0.1'),
+            'negative-numeric-literal04': ('{% ifequal -1 -1 %}x{% endifequal %}', {}, 'x'),
+            'negative-numeric-literal05': ('{{ foo|default:-1 }}', {'foo': None}, '-1'),
 
             ### REGROUP TAG ###########################################################
             'regroup01': ('{% regroup data by bar as grouped %}' + \
@@ -821,6 +860,20 @@
                           '{% endfor %},' + \
                           '{% endfor %}',
                           {}, ''),
+                          
+            'regroup03': ('{% regroup data by created|date:"F Y" as grouped %}' + \
+                          '{% for group in grouped %}' + \
+                          '{{ group.grouper }}' + \
+                          '({% for item in group.list %}' + \
+                          '{{ item.created|date:"d" }}' + \
+                          '{% endfor %})' + \
+                          '{% endfor %}',                          
+                          {'data': [
+                              {'created': datetime(2008, 1, 1)},
+                              {'created': datetime(2008, 2, 2)},
+                              {'created': datetime(2008, 3, 3)},
+                              {'created': datetime(2008, 4, 4)},
+                          ]}, 'January 2008(01)February 2008(02)March 2008(03)April 2008(04)'),
 
             ### TEMPLATETAG TAG #######################################################
             'templatetag01': ('{% templatetag openblock %}', {}, '{%'),
@@ -857,10 +910,20 @@
             ### WITH TAG ########################################################
             'with01': ('{% with dict.key as key %}{{ key }}{% endwith %}', {'dict': {'key':50}}, '50'),
             'with02': ('{{ key }}{% with dict.key as key %}{{ key }}-{{ dict.key }}-{{ key }}{% endwith %}{{ key }}', {'dict': {'key':50}}, ('50-50-50', 'INVALID50-50-50INVALID')),
+            'with03': ('{% with a as b, b as a %}{{ a }}{{ b }}{% endwith %}', {'a': 'A', 'b': 'B'}, 'BA'),
+            'with04': ('{% with a as b , b as a %}{{ a }}{{ b }}{% endwith %}', {'a': 'A', 'b': 'B'}, 'BA'),
+            'with05': ('{% with a as b, b as a, "," as s %}{{ a }}{{ s }}{{ b }}{% endwith %}', {'a': 'A', 'b': 'B'}, 'B,A'),
+            'with06': ('{% with a as b, \',\' as s, b as a %}{{ a }}{{ s }}{{ b }}{% endwith %}', {'a': 'A', 'b': 'B'}, 'B,A'),
 
             'with-error01': ('{% with dict.key xx key %}{{ key }}{% endwith %}', {'dict': {'key':50}}, template.TemplateSyntaxError),
             'with-error02': ('{% with dict.key as %}{{ key }}{% endwith %}', {'dict': {'key':50}}, template.TemplateSyntaxError),
-
+            'with-error03': ('{% with a as x, as y %}x{% endwith %}', {'a': 'A', 'b': 'B'}, template.TemplateSyntaxError),
+            'with-error04': ('{% with a as x, b as %}x{% endwith %}', {'a': 'A', 'b': 'B'}, template.TemplateSyntaxError),
+            'with-error05': ('{% with as x, b as y %}x{% endwith %}', {'a': 'A', 'b': 'B'}, template.TemplateSyntaxError),                        
+            'with-error06': ('{% with a as x | b as y %}x{% endwith %}', {'a': 'A', 'b': 'B'}, template.TemplateSyntaxError),
+            'with-error07': ('{% with a as x xxx b as y %}x{% endwith %}', {'a': 'A', 'b': 'B'}, template.TemplateSyntaxError),
+            'with-error08': ('{% with a xx x, b xx y %}x{% endwith %}', {'a': 'A', 'b': 'B'}, template.TemplateSyntaxError),
+                        
             ### NOW TAG ########################################################
             # Simple case
             'now01': ('{% now "j n Y"%}', {}, str(datetime.now().day) + ' ' + str(datetime.now().month) + ' ' + str(datetime.now().year)),
@@ -877,6 +940,7 @@
             'url03': ('{% url regressiontests.templates.views.index %}', {}, '/url_tag/'),
             'url04': ('{% url named.client client.id %}', {'client': {'id': 1}}, '/url_tag/named-client/1/'),
             'url05': (u'{% url метка_оператора v %}', {'v': u'Ω'}, '/url_tag/%D0%AE%D0%BD%D0%B8%D0%BA%D0%BE%D0%B4/%CE%A9/'),
+            'url06': (u'{% url "метка_оператора" v %}', {'v': u'Ω'}, '/url_tag/%D0%AE%D0%BD%D0%B8%D0%BA%D0%BE%D0%B4/%CE%A9/'),
 
             # Failures
             'url-fail01': ('{% url %}', {}, template.TemplateSyntaxError),
