Browse Source

Merge pull request #983 from Tecnativa/9.0-fix981

[FIX][auth_signup_verify_email] Remove error from logs
pull/1148/head
Pedro M. Baeza 7 years ago
committed by GitHub
parent
commit
554ac958db
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      auth_signup_verify_email/tests/test_verify_email.py
  2. 3
      dead_mans_switch_client/tests/test_dead_mans_switch_client.py
  3. 7
      html_image_url_extractor/tests/test_extractor.py

3
auth_signup_verify_email/tests/test_verify_email.py

@ -6,6 +6,7 @@ from urllib import urlencode
from lxml.html import document_fromstring from lxml.html import document_fromstring
from openerp import _ from openerp import _
from openerp.tests.common import HttpCase from openerp.tests.common import HttpCase
from openerp.tools import mute_logger
class UICase(HttpCase): class UICase(HttpCase):
@ -58,6 +59,8 @@ class UICase(HttpCase):
doc = self.html_doc(data=self.data) doc = self.html_doc(data=self.data)
self.assertTrue(self.search_text(doc, self.msg["badmail"])) 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): def test_good_email(self):
"""Test acceptance of good emails. """Test acceptance of good emails.

3
dead_mans_switch_client/tests/test_dead_mans_switch_client.py

@ -2,11 +2,14 @@
# © 2015 Therp BV <http://therp.nl> # © 2015 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.tests.common import TransactionCase from openerp.tests.common import TransactionCase
from openerp.tools import mute_logger
class TestDeadMansSwitchClient(TransactionCase): class TestDeadMansSwitchClient(TransactionCase):
def test_dead_mans_switch_client(self): def test_dead_mans_switch_client(self):
# test unconfigured case # test unconfigured case
with mute_logger("openerp.addons.dead_mans_switch_client"
".models.dead_mans_switch_client"):
self.env['ir.config_parameter'].search([ self.env['ir.config_parameter'].search([
('key', '=', 'dead_mans_switch_client.url')]).unlink() ('key', '=', 'dead_mans_switch_client.url')]).unlink()
self.env['dead.mans.switch.client'].alive() self.env['dead.mans.switch.client'].alive()

7
html_image_url_extractor/tests/test_extractor.py

@ -4,6 +4,7 @@
from lxml import etree from lxml import etree
from openerp.tests.common import TransactionCase from openerp.tests.common import TransactionCase
from openerp.tools import mute_logger
class ExtractorCase(TransactionCase): class ExtractorCase(TransactionCase):
@ -44,6 +45,8 @@ class ExtractorCase(TransactionCase):
self.assertEqual("/path/%d" % n, url) self.assertEqual("/path/%d" % n, url)
self.assertEqual(n, 0) self.assertEqual(n, 0)
@mute_logger("openerp.addons.html_image_url_extractor.models"
".ir_fields_converter")
def test_empty_html(self): def test_empty_html(self):
"""Empty HTML handled correctly.""" """Empty HTML handled correctly."""
for laps, text in self.imgs_from_html(""): for laps, text in self.imgs_from_html(""):
@ -52,6 +55,8 @@ class ExtractorCase(TransactionCase):
with self.assertRaises(etree.XMLSyntaxError): with self.assertRaises(etree.XMLSyntaxError):
list(self.imgs_from_html("", fail=True)) list(self.imgs_from_html("", fail=True))
@mute_logger("openerp.addons.html_image_url_extractor.models"
".ir_fields_converter")
def test_false_html(self): def test_false_html(self):
"""``False`` HTML handled correctly.""" """``False`` HTML handled correctly."""
for laps, text in self.imgs_from_html(False): for laps, text in self.imgs_from_html(False):
@ -60,6 +65,8 @@ class ExtractorCase(TransactionCase):
with self.assertRaises(TypeError): with self.assertRaises(TypeError):
list(self.imgs_from_html(False, fail=True)) 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): def test_bad_html(self):
"""Bad HTML handled correctly.""" """Bad HTML handled correctly."""
for laps, text in self.imgs_from_html("<<bad>"): for laps, text in self.imgs_from_html("<<bad>"):

Loading…
Cancel
Save