Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

magic-removal: Fixed template unit tests. Corrected expected output f…

…or 'spaceless' tests, added extra error condition for cycle tests.

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2030 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c983ab3e16cf74516fbb622037c9c3557f3afba0 1 parent 00f93bc
@freakboy3742 freakboy3742 authored
Showing with 4 additions and 2 deletions.
  1. +2 −0  django/template/defaulttags.py
  2. +2 −2 tests/othertests/templates.py
View
2  django/template/defaulttags.py
@@ -344,6 +344,8 @@ def cycle(parser, token):
elif len(args) == 2:
name = args[1]
+ if not hasattr(parser, '_namedCycleNodes'):
+ raise TemplateSyntaxError("No named cycles in template: '%s' is not defined" % name)
if not parser._namedCycleNodes.has_key(name):
raise TemplateSyntaxError("Named cycle '%s' does not exist" % name)
return parser._namedCycleNodes[name]
View
4 tests/othertests/templates.py
@@ -317,8 +317,8 @@ def method(self):
### I18N ##################################################################
# {% spaceless %} tag
- 'spaceless01': ("{% spaceless %} <b> <i> text </i> </b> {% endspaceless %}", {}, "<b><i> text </i></b>"),
- 'spaceless02': ("{% spaceless %} <b> \n <i> text </i> \n </b> {% endspaceless %}", {}, "<b><i> text </i></b>"),
+ 'spaceless01': ("{% spaceless %} <b> <i> text </i> </b> {% endspaceless %}", {}, "<b> <i> text </i> </b>"),
+ 'spaceless02': ("{% spaceless %} <b> \n <i> text </i> \n </b> {% endspaceless %}", {}, "<b> <i> text </i> </b>"),
'spaceless03': ("{% spaceless %}<b><i>text</i></b>{% endspaceless %}", {}, "<b><i>text</i></b>"),
# simple translation of a string delimited by '
Please sign in to comment.
Something went wrong with that request. Please try again.