From ce80cc8baa3a1c7cd2535eef2bccd5e37e7c54d6 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 14 Sep 2017 14:36:33 +0200 Subject: [PATCH] [FIX][auth_signup_verify_email] Remove error from logs This fixes #981. --- auth_signup_verify_email/tests/test_verify_email.py | 3 +++ .../tests/test_dead_mans_switch_client.py | 9 ++++++--- html_image_url_extractor/tests/test_extractor.py | 7 +++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/auth_signup_verify_email/tests/test_verify_email.py b/auth_signup_verify_email/tests/test_verify_email.py index a3649cd7d..44ef987bb 100644 --- a/auth_signup_verify_email/tests/test_verify_email.py +++ b/auth_signup_verify_email/tests/test_verify_email.py @@ -6,6 +6,7 @@ from urllib import urlencode from lxml.html import document_fromstring from openerp import _ from openerp.tests.common import HttpCase +from openerp.tools import mute_logger class UICase(HttpCase): @@ -58,6 +59,8 @@ class UICase(HttpCase): doc = self.html_doc(data=self.data) self.assertTrue(self.search_text(doc, self.msg["badmail"])) + @mute_logger("openerp.addons.mail.models.mail_mail") + @mute_logger("openerp.addons.auth_signup_verify_email.controllers.main") def test_good_email(self): """Test acceptance of good emails. diff --git a/dead_mans_switch_client/tests/test_dead_mans_switch_client.py b/dead_mans_switch_client/tests/test_dead_mans_switch_client.py index e4d849f93..65c2b2572 100644 --- a/dead_mans_switch_client/tests/test_dead_mans_switch_client.py +++ b/dead_mans_switch_client/tests/test_dead_mans_switch_client.py @@ -2,14 +2,17 @@ # © 2015 Therp BV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp.tests.common import TransactionCase +from openerp.tools import mute_logger class TestDeadMansSwitchClient(TransactionCase): def test_dead_mans_switch_client(self): # test unconfigured case - self.env['ir.config_parameter'].search([ - ('key', '=', 'dead_mans_switch_client.url')]).unlink() - self.env['dead.mans.switch.client'].alive() + with mute_logger("openerp.addons.dead_mans_switch_client" + ".models.dead_mans_switch_client"): + self.env['ir.config_parameter'].search([ + ('key', '=', 'dead_mans_switch_client.url')]).unlink() + self.env['dead.mans.switch.client'].alive() # test configured case self.env['ir.config_parameter'].set_param( 'dead_mans_switch_client.url', 'fake_url') diff --git a/html_image_url_extractor/tests/test_extractor.py b/html_image_url_extractor/tests/test_extractor.py index c511aa5f8..c68193a3c 100644 --- a/html_image_url_extractor/tests/test_extractor.py +++ b/html_image_url_extractor/tests/test_extractor.py @@ -4,6 +4,7 @@ from lxml import etree from openerp.tests.common import TransactionCase +from openerp.tools import mute_logger class ExtractorCase(TransactionCase): @@ -44,6 +45,8 @@ class ExtractorCase(TransactionCase): self.assertEqual("/path/%d" % n, url) self.assertEqual(n, 0) + @mute_logger("openerp.addons.html_image_url_extractor.models" + ".ir_fields_converter") def test_empty_html(self): """Empty HTML handled correctly.""" for laps, text in self.imgs_from_html(""): @@ -52,6 +55,8 @@ class ExtractorCase(TransactionCase): with self.assertRaises(etree.XMLSyntaxError): list(self.imgs_from_html("", fail=True)) + @mute_logger("openerp.addons.html_image_url_extractor.models" + ".ir_fields_converter") def test_false_html(self): """``False`` HTML handled correctly.""" for laps, text in self.imgs_from_html(False): @@ -60,6 +65,8 @@ class ExtractorCase(TransactionCase): with self.assertRaises(TypeError): list(self.imgs_from_html(False, fail=True)) + @mute_logger("openerp.addons.html_image_url_extractor.models" + ".ir_fields_converter") def test_bad_html(self): """Bad HTML handled correctly.""" for laps, text in self.imgs_from_html("<"):