Mercurial > libervia-backend
diff src/test/test_plugin_misc_text_syntaxes.py @ 1412:979210da778a
test: fix the tests
author | souliane <souliane@mailoo.org> |
---|---|
date | Fri, 17 Apr 2015 19:06:39 +0200 |
parents | 069ad98b360d |
children | d17772b0fe22 |
line wrap: on
line diff
--- a/src/test/test_plugin_misc_text_syntaxes.py Fri Apr 17 19:05:37 2015 +0200 +++ b/src/test/test_plugin_misc_text_syntaxes.py Fri Apr 17 19:06:39 2015 +0200 @@ -61,7 +61,7 @@ self.text_syntaxes = plugin_misc_text_syntaxes.TextSyntaxes(self.host) def test_xhtml_sanitise(self): - expected = """<div> + expected = u"""<div> <style>/* deleted */</style> <body> <a href="">a link</a> @@ -81,7 +81,7 @@ return d def test_styles_sanitise(self): - expected = """<p style="color: blue">test <strong>retest</strong><br/><span style="color: #cf2828; font-size: 3px; color: red; color: red !important; font-size: 100px !important; font-size: 100%; font-size: 100px; font-size: 100; font-size: 100 %; color: rgba(0, 0, 0, 0.1); color: rgb(35,79,255); background-color: no-repeat"> toto </span></p>""" + expected = u"""<p style="color: blue">test <strong>retest</strong><br/><span style="color: #cf2828; font-size: 3px; color: red; color: red !important; font-size: 100px !important; font-size: 100%; font-size: 100px; font-size: 100; font-size: 100 %; color: rgba(0, 0, 0, 0.1); color: rgb(35,79,255); background-color: no-repeat"> toto </span></p>""" d = self.text_syntaxes.clean_xhtml(self.EVIL_HTML2) d.addCallback(self.assertEqualXML, expected) @@ -100,11 +100,11 @@ return d def test_removeXHTMLMarkups(self): - expected = """ a link another link a paragraph secret EVIL! of EVIL! Password: annoying EVIL!spam spam SPAM! """ + expected = u""" a link another link a paragraph secret EVIL! of EVIL! Password: annoying EVIL!spam spam SPAM! """ result = self.text_syntaxes._removeMarkups(self.EVIL_HTML1) self.assertEqual(re.sub(r"\s+", " ", result).rstrip(), expected.rstrip()) - expected = """test retest toto""" + expected = u"""test retest toto""" result = self.text_syntaxes._removeMarkups(self.EVIL_HTML2) self.assertEqual(re.sub(r"\s+", " ", result).rstrip(), expected.rstrip())