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