Пример #1
0
 def test_alerts(self):
     self.assertEqual(
         cm('[info]test[/info]'),
         '<div class="alert alert-info">\n<div class="media">' +
         '<span class="fa fa-3x fa-info-circle media-object pull-left">' +
         '</span><div class="media-body">\n<p>test</p>\n</div>\n</div>\n</div>'
     )
Пример #2
0
 def test_alerts(self):
     self.assertEqual(
         cm('[info]test[/info]'),
         '<div class="alert alert-info">\n<div class="media">' +
         '<span class="fa fa-3x fa-info-circle media-object pull-left">' +
         '</span><div class="media-body">\n<p>test</p>\n</div>\n</div>\n</div>'
     )
Пример #3
0
 def test_unicode(self):
     self.assertEqual(cm(smart_text('\xce\xa9')), smart_text('<p>\xce\xa9</p>'))
Пример #4
0
 def test_strikethrough(self):
     self.assertEqual(cm('---test---'), '<p><s>test</s></p>')
Пример #5
0
 def test_references(self):
     self.assertEqual(cm('[article:%d]' % self.article.id), '<p><a href="/articles/%d/test/">Test</a></p>' % self.article.id)
     self.assertEqual(cm('[image:%d]' % self.image.id), '<p><img alt="Test" src="%s" title="Test" /></p>' % self.image.image.url)
Пример #6
0
 def test_linkify(self):
     self.assertEqual(cm('http://example.org'), '<p><a href="http://example.org">http://example.org</a></p>')
Пример #7
0
 def test_basic_markup(self):
     self.assertEqual(cm('**test**'), '<p><strong>test</strong></p>')
     self.assertEqual(cm('# Test'), '<h1 id="test">Test</h1>')
     self.assertEqual(cm('[test](http://example.org)'), '<p><a href="http://example.org">test</a></p>')
     self.assertEqual(cm('`test`'), '<p><code>test</code></p>')
Пример #8
0
 def test_unicode(self):
     self.assertEqual(cm(smart_text('\xce\xa9')), smart_text('<p>\xce\xa9</p>'))
Пример #9
0
 def test_escaping(self):
     self.assertEqual(cm('<>'), '<p>&lt;&gt;</p>')
Пример #10
0
 def test_strikethrough(self):
     self.assertEqual(cm('---test---'), '<p><s>test</s></p>')
Пример #11
0
 def test_references(self):
     self.assertEqual(cm('[article:%d]' % self.article.id), '<p><a href="/articles/%d/test/">Test</a></p>' % self.article.id)
     self.assertEqual(cm('[image:%d]' % self.image.id), '<p><img alt="Test" src="%s" title="Test" /></p>' % self.image.image.url)
Пример #12
0
 def test_linkify(self):
     self.assertEqual(cm('http://example.org'), '<p><a href="http://example.org">http://example.org</a></p>')
Пример #13
0
 def test_basic_markup(self):
     self.assertEqual(cm('**test**'), '<p><strong>test</strong></p>')
     self.assertEqual(cm('# Test'), '<h1 id="test">Test</h1>')
     self.assertEqual(cm('[test](http://example.org)'), '<p><a href="http://example.org">test</a></p>')
     self.assertEqual(cm('`test`'), '<p><code>test</code></p>')