|
20 | 20 | from contextlib import contextmanager
|
21 | 21 | from odoo import models
|
22 | 22 | from odoo.addons.component.tests.common import SavepointComponentCase
|
| 23 | +from odoo.tools import mute_logger |
23 | 24 |
|
24 | 25 | from vcr import VCR
|
25 | 26 |
|
@@ -160,11 +161,16 @@ def _import_record(self, model_name, magento_id, cassette=True):
|
160 | 161 | filename = 'import_%s_%s' % (table_name[8:], str(magento_id))
|
161 | 162 |
|
162 | 163 | def run_import():
|
163 |
| - if self.backend.version != '1.7': |
164 |
| - return self.env[model_name].import_record( |
165 |
| - self.backend, magento_id) |
166 |
| - with mock_urlopen_image(): |
167 |
| - self.env[model_name].import_record(self.backend, magento_id) |
| 164 | + with mute_logger( |
| 165 | + 'odoo.addons.mail.models.mail_mail', |
| 166 | + 'odoo.models.unlink', |
| 167 | + 'odoo.tests'): |
| 168 | + if self.backend.version != '1.7': |
| 169 | + return self.env[model_name].import_record( |
| 170 | + self.backend, magento_id) |
| 171 | + with mock_urlopen_image(): |
| 172 | + self.env[model_name].import_record( |
| 173 | + self.backend, magento_id) |
168 | 174 |
|
169 | 175 | if cassette:
|
170 | 176 | with self.recorder.use_cassette(filename):
|
@@ -271,5 +277,10 @@ class MagentoSyncTestCase(MagentoTestCase):
|
271 | 277 |
|
272 | 278 | def setUp(self):
|
273 | 279 | super(MagentoSyncTestCase, self).setUp()
|
274 |
| - with recorder.use_cassette('metadata'): |
275 |
| - self.backend.synchronize_metadata() |
| 280 | + # Mute logging of notifications about new checkpoints |
| 281 | + with mute_logger( |
| 282 | + 'odoo.addons.mail.models.mail_mail', |
| 283 | + 'odoo.models.unlink', |
| 284 | + 'odoo.tests'): |
| 285 | + with recorder.use_cassette('metadata'): |
| 286 | + self.backend.synchronize_metadata() |
0 commit comments