예제 #1
0
    def test_string_render_text(self):
        string = StringValue(
            "This is a paragraph. <b>This is some bold <i>and now italic</i></b> text"
        )

        self.assertEqual(
            string.render_text(),
            "This is a paragraph. This is some bold and now italic text")
예제 #2
0
    def test_br_tags_converted_to_newlines(self):
        string = StringValue("foo<br>bar<br>baz")
        self.assertEqual(string.render_text(), "foo\nbar\nbaz")

        string = StringValue("<br/><b>foo</b><br/><i>bar</i><br/>")
        self.assertEqual(string.render_text(), "\nfoo\nbar\n")
예제 #3
0
 def test_special_chars_unescaped(self):
     string = StringValue("<b>foo</b><i> &amp; bar</i>")
     self.assertEqual(string.render_text(), "foo & bar")