def test_markdown(self):
        try:
            import markdown
        except __HOLE__:
            markdown = None

        markdown_content = """Paragraph 1

## An h2"""

        t = Template("{{ markdown_content|markdown }}")
        rendered = t.render(Context(locals())).strip()
        if markdown:
            pattern = re.compile("""<p>Paragraph 1\s*</p>\s*<h2>\s*An h2</h2>""")
            self.assert_(pattern.match(rendered))
        else:
            self.assertEqual(rendered, markdown_content)
dataset/ETHPy150Open CollabQ/CollabQ/.google_appengine/lib/django/tests/regressiontests/markup/tests.py/Templates.test_markdown