~netlandish/django-wiki

15c1f8314f2b1cd525be12435e97a409efb2d5a5 — Mads Jensen 6 years ago be65c45
Added tests for the wikilinks plugin.
2 files changed, 12 insertions(+), 1 deletions(-)

M src/wiki/plugins/macros/mdx/wikilinks.py
A tests/plugins/macros/test_links.py
M src/wiki/plugins/macros/mdx/wikilinks.py => src/wiki/plugins/macros/mdx/wikilinks.py +0 -1
@@ 1,4 1,3 @@
#!/usr/bin/env python
"""
Extend the shipped Markdown extension 'wikilinks'
"""

A tests/plugins/macros/test_links.py => tests/plugins/macros/test_links.py +12 -0
@@ 0,0 1,12 @@
from tests.base import RequireRootArticleMixin, TestBase
from wiki.core import markdown
from wiki.plugins.macros.mdx.wikilinks import WikiLinkExtension


class WikiLinksTests(RequireRootArticleMixin, TestBase):
    def test_wikilink(self):
        md = markdown.ArticleMarkdown(article=self.root_article, extensions=[WikiLinkExtension()])
        md_text = md.convert('[[Root Article]]')
        self.assertEqual(
            md_text, '<p><a class="wiki_wikilink" href="/Root_Article/">Root Article</a></p>'
        )