From cbf3c82e88c8dfb5b9829a60262caa35d085c241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 14 Nov 2012 11:38:49 +0100 Subject: [PATCH] [IMP] tools: added a true test for html_sanitize, some function renaming. bzr revid: tde@openerp.com-20121114103849-hbxni04dpog1fxju --- openerp/tests/test_mail.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/openerp/tests/test_mail.py b/openerp/tests/test_mail.py index 0d6c72ff915..975a8b846ee 100755 --- a/openerp/tests/test_mail.py +++ b/openerp/tests/test_mail.py @@ -124,8 +124,7 @@ bert.tartopoils@miam.miam class TestSanitizer(unittest2.TestCase): - """ Test the html sanitizer """ - # TDE note: could be improved by actually checking the output + """ Test the html sanitizer that filters html to remove unwanted attributes """ def test_simple(self): x = "yop" @@ -135,15 +134,19 @@ class TestSanitizer(unittest2.TestCase): x = 'lala

yop

xxx' self.assertEqual(x, html_sanitize(x)) - def test_no_exception(self): - html_sanitize(HTML_SOURCE) + def test_html(self): + sanitized_html = html_sanitize(HTML_SOURCE) + for tag in ['', '
', '', '', '', '', '
  • ', '
    ', '