Files
django-wiki/tests/plugins/macros/test_macro.py
2025-09-17 07:52:16 -05:00

19 lines
707 B
Python

from wiki.core import markdown
from tests.base import RequireRootArticleMixin
from tests.base import TestBase
class MacroTests(RequireRootArticleMixin, TestBase):
def test_article_list(self):
md = markdown.ArticleMarkdown(article=self.root_article)
md_text = md.convert("[article_list depth:2]")
self.assertIn("Nothing below this level", md_text)
self.assertNotIn("[article_list depth:2]", md_text)
def test_escape(self):
md = markdown.ArticleMarkdown(article=self.root_article)
md_text = md.convert("`[article_list depth:2]`")
self.assertNotIn("Nothing below this level", md_text)
self.assertIn("[article_list depth:2]", md_text)