diff --git a/tests/othertests/markup.py b/tests/othertests/markup.py index 3fa5a3a883..2b00a8c7a5 100644 --- a/tests/othertests/markup.py +++ b/tests/othertests/markup.py @@ -1,6 +1,7 @@ # Quick tests for the markup templatetags (django.contrib.markup) from django.template import Template, Context, add_to_builtins +import re add_to_builtins('django.contrib.markup.templatetags.markup') @@ -47,7 +48,8 @@ markdown_content = """Paragraph 1 t = Template("{{ markdown_content|markdown }}") rendered = t.render(Context(locals())).strip() if markdown: - assert rendered == """

Paragraph 1

An h2

""" + pattern = re.compile("""

Paragraph 1\s*

\s*

\s*An h2

""") + assert pattern.match(rendered) else: assert rendered == markdown_content