Ticket #2397: 2397.patch
File 2397.patch, 771 bytes (added by , 18 years ago) |
---|
-
tests/othertests/markup.py
1 1 # Quick tests for the markup templatetags (django.contrib.markup) 2 2 3 3 from django.template import Template, Context, add_to_builtins 4 import re 4 5 5 6 add_to_builtins('django.contrib.markup.templatetags.markup') 6 7 … … 47 48 t = Template("{{ markdown_content|markdown }}") 48 49 rendered = t.render(Context(locals())).strip() 49 50 if 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) 51 53 else: 52 54 assert rendered == markdown_content 53 55