From e4899b80161103c908247e149c4f332ee5ad9b82 Mon Sep 17 00:00:00 2001 From: Christian Duvholt Date: Sun, 19 Jun 2016 13:17:16 +0200 Subject: [PATCH] Add test for the table-responsive extension --- wiki/tests/test_markdown.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 wiki/tests/test_markdown.py diff --git a/wiki/tests/test_markdown.py b/wiki/tests/test_markdown.py new file mode 100644 index 00000000..d02914a3 --- /dev/null +++ b/wiki/tests/test_markdown.py @@ -0,0 +1,18 @@ +from __future__ import absolute_import, unicode_literals + +from django.test import TestCase +import markdown +from wiki.core.markdown.mdx.responsivetable import ResponsiveTableExtension + +class ResponsiveTableTests(TestCase): + def setUp(self): + self.md = markdown.Markdown(extensions=[ + 'extra', + ResponsiveTableExtension() + ]) + self.md_without = markdown.Markdown(extensions=['extra']) + + def test_wrapping(self): + text = '|th|th|\n|--|--|\n|td|td|' + expected = '
\n' + self.md_without.convert(text) + '\n
' + self.assertEqual(self.md.convert(text), expected) -- 2.45.2