Loading django/template/base.py +1 −1 Original line number Diff line number Diff line Loading @@ -486,7 +486,7 @@ constant_string = constant_string.replace("\n", "") filter_raw_string = r""" ^(?P<constant>%(constant)s)| ^(?P<var>[%(var_chars)s]+|%(num)s)| (?:%(filter_sep)s (?:\s*%(filter_sep)s\s* (?P<filter_name>\w+) (?:%(arg_sep)s (?: Loading tests/regressiontests/templates/tests.py +4 −4 Original line number Diff line number Diff line Loading @@ -634,11 +634,11 @@ class Templates(unittest.TestCase): # Chained filters 'filter-syntax02': ("{{ var|upper|lower }}", {"var": "Django is the greatest!"}, "django is the greatest!"), # Raise TemplateSyntaxError for space between a variable and filter pipe 'filter-syntax03': ("{{ var |upper }}", {}, template.TemplateSyntaxError), # Allow spaces before the filter pipe 'filter-syntax03': ("{{ var |upper }}", {"var": "Django is the greatest!"}, "DJANGO IS THE GREATEST!"), # Raise TemplateSyntaxError for space after a filter pipe 'filter-syntax04': ("{{ var| upper }}", {}, template.TemplateSyntaxError), # Allow spaces after the filter pipe 'filter-syntax04': ("{{ var| upper }}", {"var": "Django is the greatest!"}, "DJANGO IS THE GREATEST!"), # Raise TemplateSyntaxError for a nonexistent filter 'filter-syntax05': ("{{ var|does_not_exist }}", {}, template.TemplateSyntaxError), Loading Loading
django/template/base.py +1 −1 Original line number Diff line number Diff line Loading @@ -486,7 +486,7 @@ constant_string = constant_string.replace("\n", "") filter_raw_string = r""" ^(?P<constant>%(constant)s)| ^(?P<var>[%(var_chars)s]+|%(num)s)| (?:%(filter_sep)s (?:\s*%(filter_sep)s\s* (?P<filter_name>\w+) (?:%(arg_sep)s (?: Loading
tests/regressiontests/templates/tests.py +4 −4 Original line number Diff line number Diff line Loading @@ -634,11 +634,11 @@ class Templates(unittest.TestCase): # Chained filters 'filter-syntax02': ("{{ var|upper|lower }}", {"var": "Django is the greatest!"}, "django is the greatest!"), # Raise TemplateSyntaxError for space between a variable and filter pipe 'filter-syntax03': ("{{ var |upper }}", {}, template.TemplateSyntaxError), # Allow spaces before the filter pipe 'filter-syntax03': ("{{ var |upper }}", {"var": "Django is the greatest!"}, "DJANGO IS THE GREATEST!"), # Raise TemplateSyntaxError for space after a filter pipe 'filter-syntax04': ("{{ var| upper }}", {}, template.TemplateSyntaxError), # Allow spaces after the filter pipe 'filter-syntax04': ("{{ var| upper }}", {"var": "Django is the greatest!"}, "DJANGO IS THE GREATEST!"), # Raise TemplateSyntaxError for a nonexistent filter 'filter-syntax05': ("{{ var|does_not_exist }}", {}, template.TemplateSyntaxError), Loading