Exemple #1
0
 def test_illegal_unicode_sub(self):
     illegal_str = u'\u0000\u0008\u000b\u000c\u000e\u001f\ufffe\uffffHello'
     illegal_str += unichr(0xd800) + unichr(0xdbff) + ' World'
     assert_equal(util.html_and_illegal_unicode_replace(illegal_str), 'Hello World')
     assert_equal(util.html_and_illegal_unicode_replace(''), '')
     assert_equal(util.html_and_illegal_unicode_replace(None), None)
     assert_equal(util.html_and_illegal_unicode_replace('WOOOooooOOo'), 'WOOOooooOOo')
Exemple #2
0
 def test_illegal_unicode_sub(self):
     illegal_str = u'\u0000\u0008\u000b\u000c\u000e\u001f\ufffe\uffffHello'
     illegal_str += unichr(0xd800) + unichr(0xdbff) + ' World'
     assert_equal(util.html_and_illegal_unicode_replace(illegal_str), 'Hello World')
     assert_equal(util.html_and_illegal_unicode_replace(''), '')
     assert_equal(util.html_and_illegal_unicode_replace(None), None)
     assert_equal(util.html_and_illegal_unicode_replace('WOOOooooOOo'), 'WOOOooooOOo')
Exemple #3
0
 def test_html_tag_sub(self):
     html_str = "<p><b>RKO</b> outta <i>NOWHERE</i>!!!</p>"
     assert_equal(util.html_and_illegal_unicode_replace(html_str),
                  'RKO outta NOWHERE!!!')
Exemple #4
0
 def test_html_tag_sub(self):
     html_str = "<p><b>RKO</b> outta <i>NOWHERE</i>!!!</p>"
     assert_equal(util.html_and_illegal_unicode_replace(html_str), 'RKO outta NOWHERE!!!')