Ticket #5478: webdesign.diff

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

small patch and test

  • django/contrib/webdesign/tests.py

     
    77>>> paragraphs(1)
    88['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.']
    99
     10>>> from django.template import loader, Context
     11>>> t = loader.get_template_from_string("{% load webdesign %}{% lorem 3 w %}")
     12>>> t.render(Context({}))
     13u'lorem ipsum dolor'
    1014"""
    1115
    1216from django.contrib.webdesign.lorem_ipsum import *
  • django/contrib/webdesign/templatetags/webdesign.py

     
    6262        count = '1'
    6363    count = parser.compile_filter(count)
    6464    if len(bits) != 1:
    65         raise TemplateSyntaxError("Incorrect format for %r tag" % tagname)
     65        raise template.TemplateSyntaxError("Incorrect format for %r tag" % tagname)
    6666    return LoremNode(count, method, common)
    6767lorem = register.tag(lorem)
Back to Top