Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 59964c2c3fba3a59d43e7514e1478cca46852595 1 parent 4f70820
Adrian Holovaty authored September 14, 2007
2  django/contrib/webdesign/templatetags/webdesign.py
@@ -62,6 +62,6 @@ def lorem(parser, token):
62 62
         count = '1'
63 63
     count = parser.compile_filter(count)
64 64
     if len(bits) != 1:
65  
-        raise TemplateSyntaxError("Incorrect format for %r tag" % tagname)
  65
+        raise template.TemplateSyntaxError("Incorrect format for %r tag" % tagname)
66 66
     return LoremNode(count, method, common)
67 67
 lorem = register.tag(lorem)
4  django/contrib/webdesign/tests.py
@@ -7,6 +7,10 @@
7 7
 >>> paragraphs(1)
8 8
 ['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.']
9 9
 
  10
+>>> from django.template import loader, Context
  11
+>>> t = loader.get_template_from_string("{% load webdesign %}{% lorem 3 w %}")
  12
+>>> t.render(Context({}))
  13
+u'lorem ipsum dolor'
10 14
 """
11 15
 
12 16
 from django.contrib.webdesign.lorem_ipsum import *

0 notes on commit 59964c2

Please sign in to comment.
Something went wrong with that request. Please try again.