Mercurial > libervia-backend
comparison src/test/test_plugin_misc_text_syntaxes.py @ 1910:55440ee00905
test: update some tests
author | souliane <souliane@mailoo.org> |
---|---|
date | Fri, 11 Mar 2016 17:42:56 +0100 |
parents | 160b0d4c6520 |
children | 2daf7b4c6756 |
comparison
equal
deleted
inserted
replaced
1909:0681d69cbe0a | 1910:55440ee00905 |
---|---|
56 | 56 |
57 EVIL_HTML2 = """<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>""" | 57 EVIL_HTML2 = """<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>""" |
58 | 58 |
59 def setUp(self): | 59 def setUp(self): |
60 self.host = helpers.FakeSAT() | 60 self.host = helpers.FakeSAT() |
61 reload(plugin_misc_text_syntaxes) # reload the plugin to avoid conflict error | |
61 self.text_syntaxes = plugin_misc_text_syntaxes.TextSyntaxes(self.host) | 62 self.text_syntaxes = plugin_misc_text_syntaxes.TextSyntaxes(self.host) |
62 | 63 |
63 def test_xhtml_sanitise(self): | 64 def test_xhtml_sanitise(self): |
64 expected = u"""<div> | 65 expected = u"""<div> |
65 <style>/* deleted */</style> | 66 <style>/* deleted */</style> |