diff --git a/django/contrib/markup/tests.py b/django/contrib/markup/tests.py
index 6903dd7..96ed857 100644
a
|
b
|
except ImportError:
|
14 | 14 | |
15 | 15 | try: |
16 | 16 | import markdown |
| 17 | markdown_vers = getattr(markdown, "version_info", 0) |
17 | 18 | except ImportError: |
18 | 19 | markdown = None |
19 | 20 | |
… |
… |
Paragraph 2 with a link_
|
38 | 39 | |
39 | 40 | .. _link: http://www.example.com/""" |
40 | 41 | |
41 | | |
42 | 42 | @unittest.skipUnless(textile, 'texttile not installed') |
43 | 43 | def test_textile(self): |
44 | 44 | t = Template("{{ textile_content|textile }}") |
… |
… |
Paragraph 2 with a link_
|
60 | 60 | pattern = re.compile("""<p>Paragraph 1\s*</p>\s*<h2>\s*An h2</h2>""") |
61 | 61 | self.assertTrue(pattern.match(rendered)) |
62 | 62 | |
63 | | @unittest.skipUnless(markdown, 'markdown no installed') |
| 63 | @unittest.skipUnless(markdown and markdown_vers >= (2,1), 'markdown not installed') |
64 | 64 | def test_markdown_attribute_disable(self): |
65 | 65 | t = Template("{% load markup %}{{ markdown_content|markdown:'safe' }}") |
66 | 66 | markdown_content = "{@onclick=alert('hi')}some paragraph" |
67 | 67 | rendered = t.render(Context({'markdown_content':markdown_content})).strip() |
68 | 68 | self.assertTrue('@' in rendered) |
69 | 69 | |
70 | | @unittest.skipUnless(markdown, 'markdown no installed') |
| 70 | @unittest.skipUnless(markdown and markdown_vers >= (2,1), 'markdown not installed') |
71 | 71 | def test_markdown_attribute_enable(self): |
72 | 72 | t = Template("{% load markup %}{{ markdown_content|markdown }}") |
73 | 73 | markdown_content = "{@onclick=alert('hi')}some paragraph" |