From 63601c66507ee5a0cd6e0e4c45895ee4e400b709 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 25 Nov 2013 18:49:56 +0100 Subject: [PATCH] [FIX] html_sanitize does not raise exception for empty string anymore. correct related test bzr revid: chs@openerp.com-20131125174956-1y13zszzf9h2pkl6 --- openerp/tests/test_mail.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/openerp/tests/test_mail.py b/openerp/tests/test_mail.py index 36d49e34997..3e822cb190e 100755 --- a/openerp/tests/test_mail.py +++ b/openerp/tests/test_mail.py @@ -82,12 +82,8 @@ class TestSanitizer(unittest2.TestCase): self.assertNotIn('javascript', html, 'html_sanitize did not remove a malicious javascript') self.assertTrue('ha.ckers.org' not in html or 'http://ha.ckers.org/xss.css' in html, 'html_sanitize did not remove a malicious code in %s (%s)' % (content, html)) - # Raise an exception if the node is an empty string without any root tag - with self.assertRaises(etree.ParserError): - content = "" # down-level hidden block - html = html_sanitize(content, silent=False) - - + content = "" # down-level hidden block + self.assertEquals(html_sanitize(content, silent=False), '') def test_html(self): sanitized_html = html_sanitize(test_mail_examples.MISC_HTML_SOURCE)