mirror of
https://github.com/django/django.git
synced 2025-06-08 21:19:13 +00:00
magic-removal: Fixed template unit tests. Corrected expected output for '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
This commit is contained in:
parent
00f93bc7bb
commit
c983ab3e16
@ -344,6 +344,8 @@ def cycle(parser, token):
|
|||||||
|
|
||||||
elif len(args) == 2:
|
elif len(args) == 2:
|
||||||
name = args[1]
|
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):
|
if not parser._namedCycleNodes.has_key(name):
|
||||||
raise TemplateSyntaxError("Named cycle '%s' does not exist" % name)
|
raise TemplateSyntaxError("Named cycle '%s' does not exist" % name)
|
||||||
return parser._namedCycleNodes[name]
|
return parser._namedCycleNodes[name]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user