diff options
| author | Thibault Delavallée <tde@odoo.com> | 2020-11-26 08:42:58 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2020-11-26 08:47:04 +0000 |
| commit | 92ff1379b0492765fd0ba9863a9ce13fba7eeb4a (patch) | |
| tree | 95885636ad6f5810d150d9c0c886c3528344b5bf /addons | |
| parent | def98d2375a8a906092293f0aa1ce03bf948d2d3 (diff) | |
[FIX] test_mail: make tests reproducible and independent from bus state
Some tests are currently dependent on bus state when computing number of
notifications sent. For example install Crm then test_mail_full. Some
tests crash as too much notifications are found in the bus.
We therefore clean remaining bus notifications before running tests to
ensure we check notifications during test itself. This make tests more
easy to reproduce.
Task ID-2390314
PR #62061
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/test_mail/tests/test_message_management.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/test_mail/tests/test_message_management.py b/addons/test_mail/tests/test_message_management.py index b2c437ce2db..289b36817a1 100644 --- a/addons/test_mail/tests/test_message_management.py +++ b/addons/test_mail/tests/test_message_management.py @@ -79,6 +79,7 @@ class TestMailResend(TestMailCommon): @mute_logger('odoo.addons.mail.models.mail_mail') def test_remove_mail_become_canceled(self): # two failure sent on bus, one for each mail + self._reset_bus() with self.mock_mail_gateway(), self.assertBus([(self.cr.dbname, 'res.partner', self.partner_admin.id)] * 2): message = self.test_record.with_user(self.user_admin).message_post(partner_ids=self.partners.ids, subtype_xmlid='mail.mt_comment', message_type='notification') @@ -101,6 +102,7 @@ class TestMailResend(TestMailCommon): @mute_logger('odoo.addons.mail.models.mail_mail') def test_cancel_all(self): + self._reset_bus() with self.mock_mail_gateway(), self.assertBus([(self.cr.dbname, 'res.partner', self.partner_admin.id)] * 2): message = self.test_record.with_user(self.user_admin).message_post(partner_ids=self.partners.ids, subtype_xmlid='mail.mt_comment', message_type='notification') |
