~netlandish/django-wiki

aed3ef2ac30b39c40317b066e641921d604f9253 — Mathias Rav 6 years ago 5e6ef92
Add test for text before and after image
1 files changed, 8 insertions(+), 0 deletions(-)

M tests/plugins/images/test_markdown.py
M tests/plugins/images/test_markdown.py => tests/plugins/images/test_markdown.py +8 -0
@@ 3,6 3,14 @@ from wiki.core import markdown


class ImageMarkdownTests(RequireRootArticleMixin, TestBase):
    def test_before_and_after(self):
        md = markdown.ArticleMarkdown(article=self.root_article)
        md_text = md.convert("before [image:1 align:left] after")
        before_pos = md_text.index('before')
        figure_pos = md_text.index('<figure')
        after_pos = md_text.index('after')
        self.assertTrue(before_pos < figure_pos < after_pos)

    def test_markdown(self):
        md = markdown.ArticleMarkdown(article=self.root_article)
        md_text = md.convert("[image:1 align:left]")