Skip to content

Commit

Permalink
Fixed #2397 -- fixed markdown test to be a bit more lenient in what c…
Browse files Browse the repository at this point in the history
…ounts as a

pass due to whitespace differences between markdown versions. Thanks to
shields@msrl.com for the patch.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3420 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Jul 22, 2006
1 parent 1687b02 commit dd19218
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/othertests/markup.py
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,7 @@
# Quick tests for the markup templatetags (django.contrib.markup) # Quick tests for the markup templatetags (django.contrib.markup)


from django.template import Template, Context, add_to_builtins from django.template import Template, Context, add_to_builtins
import re


add_to_builtins('django.contrib.markup.templatetags.markup') add_to_builtins('django.contrib.markup.templatetags.markup')


Expand Down Expand Up @@ -47,7 +48,8 @@
t = Template("{{ markdown_content|markdown }}") t = Template("{{ markdown_content|markdown }}")
rendered = t.render(Context(locals())).strip() rendered = t.render(Context(locals())).strip()
if markdown: if markdown:
assert rendered == """<p>Paragraph 1</p><h2>An h2</h2>""" pattern = re.compile("""<p>Paragraph 1\s*</p>\s*<h2>\s*An h2</h2>""")
assert pattern.match(rendered)
else: else:
assert rendered == markdown_content assert rendered == markdown_content


Expand Down

0 comments on commit dd19218

Please sign in to comment.