Ticket #2397: 2397.patch

File 2397.patch, 771 bytes (added by shields@…, 18 years ago)
  • tests/othertests/markup.py

     
    11# Quick tests for the markup templatetags (django.contrib.markup)
    22
    33from django.template import Template, Context, add_to_builtins
     4import re
    45
    56add_to_builtins('django.contrib.markup.templatetags.markup')
    67
     
    4748t = Template("{{ markdown_content|markdown }}")
    4849rendered = t.render(Context(locals())).strip()
    4950if markdown:
    50     assert rendered == """<p>Paragraph 1</p><h2>An h2</h2>"""
     51    pattern = re.compile("""<p>Paragraph 1\s*</p>\s*<h2>An h2</h2>""")
     52    assert pattern.match(rendered)
    5153else:
    5254    assert rendered == markdown_content
    5355
Back to Top