From adb817ca96c8a185d196bbd2b6aa6e2c60b6fcc8 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Thu, 26 Nov 2020 17:35:44 +0100 Subject: [PATCH] [IMP] Mute logging related to checkpoint notifications in tests ``` 2020-11-05 13:36:35,202 6822 INFO openerp_test odoo.tests: skip sending email in test mode 2020-11-05 13:36:35,206 6822 INFO openerp_test odoo.addons.mail.models.mail_mail: Mail with ID 1 and Message-Id '<342741149332557.1604583395.110157728195190-openerp-1-connector.checkpoint@travis-job-14c1db44-ca6c-40e2-82ff-03dcf3df66dc>' successfully sent 2020-11-05 13:36:35,227 6822 INFO openerp_test odoo.models.unlink: User #1 deleted mail.mail records with IDs: [1] 2020-11-05 13:36:35,228 6822 INFO openerp_test odoo.addons.mail.models.mail_mail: Sent batch 1 emails via mail server ID #False ``` --- connector_magento/__manifest__.py | 2 +- connector_magento/i18n/connector_magento.pot | 2 +- connector_magento/i18n/de.po | 2 +- connector_magento/i18n/es.po | 2 +- connector_magento/i18n/fr.po | 2 +- connector_magento/i18n/it.po | 2 +- connector_magento/i18n/nl.po | 2 +- connector_magento/i18n/pt_BR.po | 2 +- connector_magento/i18n/sl.po | 2 +- connector_magento/tests/common.py | 25 ++++++++++++++------ connector_magento/tests/magento2/common.py | 9 +++++-- 11 files changed, 34 insertions(+), 18 deletions(-) diff --git a/connector_magento/__manifest__.py b/connector_magento/__manifest__.py index 3fe0401c2..eb8861d8c 100644 --- a/connector_magento/__manifest__.py +++ b/connector_magento/__manifest__.py @@ -3,7 +3,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). {'name': 'Magento Connector', - 'version': '12.0.1.1.0', + 'version': '12.0.1.1.2', 'category': 'Connector', 'depends': ['account', 'base_technical_user', diff --git a/connector_magento/i18n/connector_magento.pot b/connector_magento/i18n/connector_magento.pot index 73c43e76b..b9e9cc5f5 100644 --- a/connector_magento/i18n/connector_magento.pot +++ b/connector_magento/i18n/connector_magento.pot @@ -253,7 +253,7 @@ msgid "Already exported" msgstr "" #. module: connector_magento -#: code:addons/connector_magento/models/sale_order/importer.py:374 +#: code:addons/connector_magento/models/sale_order/importer.py:389 #, python-format msgid "Already imported" msgstr "" diff --git a/connector_magento/i18n/de.po b/connector_magento/i18n/de.po index 573313490..3e52c6fc3 100644 --- a/connector_magento/i18n/de.po +++ b/connector_magento/i18n/de.po @@ -283,7 +283,7 @@ msgid "Already exported" msgstr "" #. module: connector_magento -#: code:addons/connector_magento/models/sale_order/importer.py:374 +#: code:addons/connector_magento/models/sale_order/importer.py:389 #, python-format msgid "Already imported" msgstr "" diff --git a/connector_magento/i18n/es.po b/connector_magento/i18n/es.po index bdefef410..da4528c9b 100644 --- a/connector_magento/i18n/es.po +++ b/connector_magento/i18n/es.po @@ -280,7 +280,7 @@ msgid "Already exported" msgstr "" #. module: connector_magento -#: code:addons/connector_magento/models/sale_order/importer.py:374 +#: code:addons/connector_magento/models/sale_order/importer.py:389 #, python-format msgid "Already imported" msgstr "" diff --git a/connector_magento/i18n/fr.po b/connector_magento/i18n/fr.po index e420135b9..452e9afda 100644 --- a/connector_magento/i18n/fr.po +++ b/connector_magento/i18n/fr.po @@ -288,7 +288,7 @@ msgid "Already exported" msgstr "Déjà exporté" #. module: connector_magento -#: code:addons/connector_magento/models/sale_order/importer.py:374 +#: code:addons/connector_magento/models/sale_order/importer.py:389 #, python-format msgid "Already imported" msgstr "Déjà importé" diff --git a/connector_magento/i18n/it.po b/connector_magento/i18n/it.po index 51fa992aa..7d991e6c2 100644 --- a/connector_magento/i18n/it.po +++ b/connector_magento/i18n/it.po @@ -290,7 +290,7 @@ msgid "Already exported" msgstr "Già esportato" #. module: connector_magento -#: code:addons/connector_magento/models/sale_order/importer.py:374 +#: code:addons/connector_magento/models/sale_order/importer.py:389 #, python-format msgid "Already imported" msgstr "Già importato" diff --git a/connector_magento/i18n/nl.po b/connector_magento/i18n/nl.po index 419f48690..96903fffa 100644 --- a/connector_magento/i18n/nl.po +++ b/connector_magento/i18n/nl.po @@ -283,7 +283,7 @@ msgid "Already exported" msgstr "" #. module: connector_magento -#: code:addons/connector_magento/models/sale_order/importer.py:374 +#: code:addons/connector_magento/models/sale_order/importer.py:389 #, python-format msgid "Already imported" msgstr "" diff --git a/connector_magento/i18n/pt_BR.po b/connector_magento/i18n/pt_BR.po index 35ca5ffd3..4ae5f89bd 100644 --- a/connector_magento/i18n/pt_BR.po +++ b/connector_magento/i18n/pt_BR.po @@ -281,7 +281,7 @@ msgid "Already exported" msgstr "Já exportado" #. module: connector_magento -#: code:addons/connector_magento/models/sale_order/importer.py:374 +#: code:addons/connector_magento/models/sale_order/importer.py:389 #, python-format msgid "Already imported" msgstr "Já importado" diff --git a/connector_magento/i18n/sl.po b/connector_magento/i18n/sl.po index e6ee9119b..8fba7c4f3 100644 --- a/connector_magento/i18n/sl.po +++ b/connector_magento/i18n/sl.po @@ -281,7 +281,7 @@ msgid "Already exported" msgstr "" #. module: connector_magento -#: code:addons/connector_magento/models/sale_order/importer.py:374 +#: code:addons/connector_magento/models/sale_order/importer.py:389 #, python-format msgid "Already imported" msgstr "" 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()