def test_render_as_html_decorates_text(self): text = "*italic* **bolded**\n# header1\n[link](www.google.pl)" html = "" letter = LetterFactory(text=text, html=html) if settings.RICH_TEXT_ENABLED: expected = '<pre><p><em>italic</em> <strong>bolded</strong></p>\n<h1>header1</h1>\n<p><a href="www.google.pl">link</a></p>\n</pre>' else: expected = "<{tag}><p>{text}</p>\n</{tag}>".format(tag="pre", text=text) self.assertEqual(letter.render_as_html(), expected)
def test_render_as_html_returns_html(self): text = "some text" html = "<pre>some_html</pre>" letter = LetterFactory(text=text, html=html) self.assertEqual(letter.render_as_html(), html)
def test_render_as_html_decorates_text(self): text = "some text" html = "" letter = LetterFactory(text=text, html=html) expected = "<{tag}>{text}</{tag}>".format(tag="pre", text=text) self.assertEqual(letter.render_as_html(), expected)