From 59964c2c3fba3a59d43e7514e1478cca46852595 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Fri, 14 Sep 2007 22:03:47 +0000 Subject: [PATCH] Fixed #5478 -- Fixed bug in lorem template tag. Thanks, racter git-svn-id: http://code.djangoproject.com/svn/django/trunk@6228 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/webdesign/templatetags/webdesign.py | 2 +- django/contrib/webdesign/tests.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/django/contrib/webdesign/templatetags/webdesign.py b/django/contrib/webdesign/templatetags/webdesign.py index 2370659f1d..1eb1790132 100644 --- a/django/contrib/webdesign/templatetags/webdesign.py +++ b/django/contrib/webdesign/templatetags/webdesign.py @@ -62,6 +62,6 @@ def lorem(parser, token): count = '1' count = parser.compile_filter(count) if len(bits) != 1: - raise TemplateSyntaxError("Incorrect format for %r tag" % tagname) + raise template.TemplateSyntaxError("Incorrect format for %r tag" % tagname) return LoremNode(count, method, common) lorem = register.tag(lorem) diff --git a/django/contrib/webdesign/tests.py b/django/contrib/webdesign/tests.py index eeb1956a01..da9237a43b 100644 --- a/django/contrib/webdesign/tests.py +++ b/django/contrib/webdesign/tests.py @@ -7,6 +7,10 @@ u'lorem ipsum dolor sit amet consectetur adipisicing' >>> paragraphs(1) ['Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'] +>>> from django.template import loader, Context +>>> t = loader.get_template_from_string("{% load webdesign %}{% lorem 3 w %}") +>>> t.render(Context({})) +u'lorem ipsum dolor' """ from django.contrib.webdesign.lorem_ipsum import *