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")
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")
def test_special_chars_unescaped(self): string = StringValue("<b>foo</b><i> & bar</i>") self.assertEqual(string.render_text(), "foo & bar")