コード例 #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")