[FIX] mute logger in some tests

bzr revid: chs@openerp.com-20131029141939-xt9093hfv8cfjkdo
This commit is contained in:
Christophe Simonis 2013-10-29 15:19:39 +01:00
parent 23e6b81833
commit a044bdbf8a
2 changed files with 5 additions and 3 deletions

View File

@ -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:

View File

@ -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 = """
<font size="2" style="color: rgb(31, 31, 31); font-family: monospace; font-variant: normal; line-height: normal; ">test1</font>
@ -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 = [