Skip to content

Commit

Permalink
magic-removal: Fixed template unit tests. Corrected expected output f…
Browse files Browse the repository at this point in the history
…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
freakboy3742 committed Jan 17, 2006
1 parent 00f93bc commit c983ab3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions django/template/defaulttags.py
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions tests/othertests/templates.py
Expand Up @@ -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 '
Expand Down

0 comments on commit c983ab3

Please sign in to comment.