~netlandish/django-wiki

e4899b80161103c908247e149c4f332ee5ad9b82 — Christian Duvholt 8 years ago 967aa1d
Add test for the table-responsive extension
1 files changed, 18 insertions(+), 0 deletions(-)

A wiki/tests/test_markdown.py
A wiki/tests/test_markdown.py => wiki/tests/test_markdown.py +18 -0
@@ 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 = '<div class="table-responsive">\n' + self.md_without.convert(text) + '\n</div>'
        self.assertEqual(self.md.convert(text), expected)