1818 markdown = None
1919
2020try :
21- import CommonMark
21+ import commonmark
2222except ImportError :
23- CommonMark = None
23+ commonmark = None
2424
2525try :
2626 import docutils
@@ -143,15 +143,15 @@ def test_no_markdown(self):
143143 {'markdown_content' : self .markdown_content })).strip ()
144144 self .assertEqual (rendered , self .markdown_content )
145145
146- @unittest .skipUnless (CommonMark , 'commonmark not installed' )
146+ @unittest .skipUnless (commonmark , 'commonmark not installed' )
147147 def test_commonmark (self ):
148148 t = Template ("{% load markup %}{{ markdown_content|commonmark }}" )
149149 rendered = t .render (
150150 Context ({'markdown_content' : self .markdown_content })).strip ()
151151 pattern = re .compile ("""<p>Paragraph 1\s*</p>\s*<h2>\s*An h2</h2>""" )
152152 self .assertTrue (pattern .match (rendered ))
153153
154- @unittest .skipUnless (CommonMark , 'commonmark not installed' )
154+ @unittest .skipUnless (commonmark , 'commonmark not installed' )
155155 def test_commonmark_html_code (self ):
156156 t = Template ("{% load markup %}{{ markdown_content|commonmark }}" )
157157 rendered = t .render (Context ({
@@ -163,7 +163,7 @@ def test_commonmark_html_code(self):
163163 )
164164 self .assertTrue (pattern .match (rendered ))
165165
166- @unittest .skipUnless (CommonMark , 'commonmark not installed' )
166+ @unittest .skipUnless (commonmark , 'commonmark not installed' )
167167 def test_commonmark_html_iframe_code (self ):
168168 t = Template ("{% load markup %}{{ markdown_content|commonmark }}" )
169169 rendered = t .render (Context ({
@@ -177,13 +177,13 @@ def test_commonmark_html_iframe_code(self):
177177 )
178178 self .assertTrue (pattern .match (rendered ))
179179
180- @unittest .skipUnless (CommonMark , 'commonmark not installed' )
180+ @unittest .skipUnless (commonmark , 'commonmark not installed' )
181181 def test_commonmark_empty_str (self ):
182182 t = Template ("{% load markup %}{{ markdown_content|commonmark }}" )
183183 rendered = t .render (Context ({'markdown_content' : '' })).strip ()
184184 self .assertEqual (rendered , '' )
185185
186- @unittest .skipUnless (CommonMark , 'commonmark not installed' )
186+ @unittest .skipUnless (commonmark , 'commonmark not installed' )
187187 def test_commonmark_none (self ):
188188 t = Template ("{% load markup %}{{ markdown_content|commonmark }}" )
189189 rendered = t .render (Context ({'markdown_content' : None })).strip ()
0 commit comments