~netlandish/django-wiki

c0035bd7d77cf7d8337bac7c109b167d69a2e7a0 — Benjamin Bach 6 years ago 90a99b5
Updates to caption tests to match expected HTML output
1 files changed, 5 insertions(+), 5 deletions(-)

M tests/plugins/images/test_markdown.py
M tests/plugins/images/test_markdown.py => tests/plugins/images/test_markdown.py +5 -5
@@ 18,23 18,23 @@ class ImageMarkdownTests(RequireRootArticleMixin, TestBase):
        self.assertNotIn("[image:1 align:left]", md_text)
        md_text = md.convert("image: [image:1 align:left]\nadasd")
        self.assertIn("<figure", md_text)
        self.assertNotIn("<caption", md_text)
        self.assertNotIn("<figcaption", md_text)
        md_text = md.convert("image: [image:1 align:right size:medium]\nadasd")
        self.assertIn("<figure", md_text)
        self.assertNotIn("<caption", md_text)
        self.assertNotIn("<figcaption", md_text)
        md_text = md.convert("image: [image:123 align:left size:medium]\nadasd")
        self.assertIn("Image not found", md_text)
        self.assertNotIn("<caption", md_text)
        self.assertNotIn("<figcaption", md_text)

    def test_caption(self):
        md = markdown.ArticleMarkdown(article=self.root_article)
        md_text = md.convert("[image:1 align:left]\n    this is visual")
        self.assertIn("<figure", md_text)
        self.assertIn("<caption", md_text)
        self.assertIn("<figcaption class="caption">this is visual</figcaption>", md_text)
        md = markdown.ArticleMarkdown(article=self.root_article)
        md_text = md.convert("[image:1 align:left]\n    this is visual\n    second line")
        self.assertIn("<figure", md_text)
        self.assertIn("<caption>this is visual\nsecond line</caption>", md_text)
        self.assertIn("<figcaption class="caption">this is visual\nsecond line</figcaption>", md_text)

    def test_escape(self):
        md = markdown.ArticleMarkdown(article=self.root_article)