Skip to content

Commit

Permalink
Add smartypants test
Browse files Browse the repository at this point in the history
  • Loading branch information
singingwolfboy committed Dec 28, 2015
1 parent dff3ae7 commit 37100bf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,18 @@ def image(self, link, title, alt_text):
self.assertFalse(html.called)
self.assertEqual(str(result), expected_result)

def test_smartypants(self, html):
text = "Don't call me Shirley"
pantsed = "Don’t call me Shirley"
expected_result = "<p>Don&rsquo;t call me Shirley</p>\n"

md = Misaka(smartypants=True)
result = md.render(text)

html.assert_called_with(pantsed, extensions=0, render_flags=0)
self.assertIsInstance(result, Markup)
self.assertEqual(result, expected_result)


class FactoryPatternTests(TestCase):
def test_init(self):
Expand Down

0 comments on commit 37100bf

Please sign in to comment.