Skip to content

Commit 37100bf

Browse files
Add smartypants test
1 parent dff3ae7 commit 37100bf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,18 @@ def image(self, link, title, alt_text):
234234
self.assertFalse(html.called)
235235
self.assertEqual(str(result), expected_result)
236236

237+
def test_smartypants(self, html):
238+
text = "Don't call me Shirley"
239+
pantsed = "Don’t call me Shirley"
240+
expected_result = "<p>Don&rsquo;t call me Shirley</p>\n"
241+
242+
md = Misaka(smartypants=True)
243+
result = md.render(text)
244+
245+
html.assert_called_with(pantsed, extensions=0, render_flags=0)
246+
self.assertIsInstance(result, Markup)
247+
self.assertEqual(result, expected_result)
248+
237249

238250
class FactoryPatternTests(TestCase):
239251
def test_init(self):

0 commit comments

Comments
 (0)