Browse Source

[FIX][auth_signup_verify_email] Remove error from logs

This fixes #981.
pull/983/head
Jairo Llopis 7 years ago
committed by Pedro M. Baeza
parent
commit
ce80cc8baa
  1. 3
      auth_signup_verify_email/tests/test_verify_email.py
  2. 9
      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 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.

9
dead_mans_switch_client/tests/test_dead_mans_switch_client.py

@ -2,14 +2,17 @@
# © 2015 Therp BV <http://therp.nl>
# 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')

7
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("<<bad>"):

Loading…
Cancel
Save