diff --git a/connector_magento/tests/common.py b/connector_magento/tests/common.py index 7c4791627..b184ed32f 100644 --- a/connector_magento/tests/common.py +++ b/connector_magento/tests/common.py @@ -20,6 +20,7 @@ from contextlib import contextmanager from odoo import models from odoo.addons.component.tests.common import SavepointComponentCase +from odoo.tools import mute_logger from vcr import VCR @@ -160,11 +161,16 @@ def _import_record(self, model_name, magento_id, cassette=True): filename = 'import_%s_%s' % (table_name[8:], str(magento_id)) def run_import(): - if self.backend.version != '1.7': - return self.env[model_name].import_record( - self.backend, magento_id) - with mock_urlopen_image(): - self.env[model_name].import_record(self.backend, magento_id) + with mute_logger( + 'odoo.addons.mail.models.mail_mail', + 'odoo.models.unlink', + 'odoo.tests'): + if self.backend.version != '1.7': + return self.env[model_name].import_record( + self.backend, magento_id) + with mock_urlopen_image(): + self.env[model_name].import_record( + self.backend, magento_id) if cassette: with self.recorder.use_cassette(filename): @@ -271,5 +277,10 @@ class MagentoSyncTestCase(MagentoTestCase): def setUp(self): super(MagentoSyncTestCase, self).setUp() - with recorder.use_cassette('metadata'): - self.backend.synchronize_metadata() + # Mute logging of notifications about new checkpoints + with mute_logger( + 'odoo.addons.mail.models.mail_mail', + 'odoo.models.unlink', + 'odoo.tests'): + with recorder.use_cassette('metadata'): + self.backend.synchronize_metadata() diff --git a/connector_magento/tests/magento2/common.py b/connector_magento/tests/magento2/common.py index e2716a0a2..f42b8eebb 100644 --- a/connector_magento/tests/magento2/common.py +++ b/connector_magento/tests/magento2/common.py @@ -13,6 +13,7 @@ from os.path import dirname, join from vcr import VCR +from odoo.tools import mute_logger from ..common import MagentoTestCase @@ -38,5 +39,9 @@ def setUp(self): class Magento2SyncTestCase(Magento2TestCase): def setUp(self): super(Magento2SyncTestCase, self).setUp() - with recorder.use_cassette('metadata'): - self.backend.synchronize_metadata() + with mute_logger( + 'odoo.addons.mail.models.mail_mail', + 'odoo.models.unlink', + 'odoo.tests'): + with recorder.use_cassette('metadata'): + self.backend.synchronize_metadata()