Browse files

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
  • Loading branch information...
1 parent 4f70820 commit 59964c2c3fba3a59d43e7514e1478cca46852595 @adrianholovaty adrianholovaty committed Sep 14, 2007
Showing with 5 additions and 1 deletion.
  1. +1 −1 django/contrib/webdesign/templatetags/webdesign.py
  2. +4 −0 django/contrib/webdesign/tests.py
View
2 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)
View
4 django/contrib/webdesign/tests.py
@@ -7,6 +7,10 @@
>>> 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 *

0 comments on commit 59964c2

Please sign in to comment.