test: store the constants in constants.py + better PEP8 compliance

This commit is contained in:
souliane 2014-01-04 15:45:08 +01:00
commit a21e3c2783

View file

@ -29,7 +29,6 @@ class SanitisationTest(helpers.SatTestCase):
self.host = helpers.FakeSAT()
self.text_syntaxes = plugin_misc_text_syntaxes.TextSyntaxes(self.host)
def test_xhtml_sanitise(self):
evil_html = """
<html>
@ -56,7 +55,7 @@ class SanitisationTest(helpers.SatTestCase):
<a href="evil-site">spam spam SPAM!</a>
<image src="evil!">
</body>
</html>""" # example from lxml: /usr/share/doc/python-lxml-doc/html/lxmlhtml.html#cleaning-up-html
</html>""" # example from lxml: /usr/share/doc/python-lxml-doc/html/lxmlhtml.html#cleaning-up-html
expected = """<div>
<style>/* deleted */</style>
@ -77,7 +76,6 @@ class SanitisationTest(helpers.SatTestCase):
d.addCallback(self.assertEqualXML, expected, ignore_blank=True)
return d
def test_styles_sanitise(self):
evil_html = """<p style='display: None; test: blah; background: url(: alert()); color: blue;'>test <strong>retest</strong><br><span style="background-color: (alert('bouh')); titi; color: #cf2828; font-size: 3px; direction: !important; color: red; color: red !important; font-size: 100px !important; font-size: 100px ! important; font-size: 100%; font-size: 100ox; font-size: 100px; font-size: 100;;;; font-size: 100 %; color: 100 px 1.7em; color: rgba(0, 0, 0, 0.1); color: rgb(35,79,255); background-color: no-repeat; background-color: :alert(1); color: (alert('XSS')); color: (window.location='http://example.org/'); color: url(:window.location='http://example.org/'); "> toto </span></p>"""