22 lines
653 B
Python
22 lines
653 B
Python
import unittest
|
|
|
|
|
|
class MarkdownTest(unittest.TestCase):
|
|
def test_happy(self):
|
|
from pillar.web import jinja
|
|
|
|
self.assertEqual('<p>je <strong>moeder</strong></p>',
|
|
jinja.do_markdown('je **moeder**').strip())
|
|
|
|
def test_bleached(self):
|
|
from pillar.web import jinja
|
|
|
|
self.assertEqual('<script>alert("hey");<script>',
|
|
jinja.do_markdown('<script>alert("hey");<script>').strip())
|
|
|
|
def test_degenerate(self):
|
|
from pillar.web import jinja
|
|
|
|
self.assertEqual(None, jinja.do_markdown(None))
|
|
self.assertEqual('', jinja.do_markdown(''))
|