Code

Ticket #5478: webdesign.diff

File webdesign.diff, 1.5 KB (added by racter, 7 years ago)

small patch and test

Line 
1Index: django/contrib/webdesign/tests.py
2===================================================================
3--- django/contrib/webdesign/tests.py   (revision 6219)
4+++ django/contrib/webdesign/tests.py   (working copy)
5@@ -7,6 +7,10 @@
6 >>> paragraphs(1)
7 ['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.']
8 
9+>>> from django.template import loader, Context
10+>>> t = loader.get_template_from_string("{% load webdesign %}{% lorem 3 w %}")
11+>>> t.render(Context({}))
12+u'lorem ipsum dolor'
13 """
14 
15 from django.contrib.webdesign.lorem_ipsum import *
16Index: django/contrib/webdesign/templatetags/webdesign.py
17===================================================================
18--- django/contrib/webdesign/templatetags/webdesign.py  (revision 6219)
19+++ django/contrib/webdesign/templatetags/webdesign.py  (working copy)
20@@ -62,6 +62,6 @@
21         count = '1'
22     count = parser.compile_filter(count)
23     if len(bits) != 1:
24-        raise TemplateSyntaxError("Incorrect format for %r tag" % tagname)
25+        raise template.TemplateSyntaxError("Incorrect format for %r tag" % tagname)
26     return LoremNode(count, method, common)
27 lorem = register.tag(lorem)