From a044bdbf8aa9bc14f880b867d209742aedb616de Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 29 Oct 2013 15:19:39 +0100 Subject: [PATCH] [FIX] mute logger in some tests bzr revid: chs@openerp.com-20131029141939-xt9093hfv8cfjkdo --- openerp/tests/test_acl.py | 5 +++-- openerp/tests/test_mail.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/openerp/tests/test_acl.py b/openerp/tests/test_acl.py index e80390cd5a2..44ec677ff6f 100644 --- a/openerp/tests/test_acl.py +++ b/openerp/tests/test_acl.py @@ -95,9 +95,10 @@ class TestACL(common.TransactionCase): part = P.browse(self.cr, self.demo_uid, pid) # accessing fields must no raise exceptions... part.name - # ... except they are restricted + # ... except if they are restricted with self.assertRaises(openerp.osv.orm.except_orm) as cm: - part.email + with mute_logger('openerp.osv.orm'): + part.email self.assertEqual(cm.exception.args[0], 'Access Denied') finally: diff --git a/openerp/tests/test_mail.py b/openerp/tests/test_mail.py index ddb8fc4a195..6450c5ba780 100755 --- a/openerp/tests/test_mail.py +++ b/openerp/tests/test_mail.py @@ -23,7 +23,7 @@ ############################################################################## import unittest2 -from openerp.tools import html_sanitize, html_email_clean, append_content_to_html, plaintext2html +from openerp.tools import html_sanitize, html_email_clean, append_content_to_html, plaintext2html, mute_logger HTML_SOURCE = """ test1 @@ -178,6 +178,7 @@ class TestSanitizer(unittest2.TestCase): html = html_sanitize(content) self.assertEqual(html, expected, 'html_sanitize is broken') + @mute_logger('openerp.tools.mail') def test_evil_malicious_code(self): # taken from https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#Tests cases = [