diff options
| author | Thibault Delavallée <tde@odoo.com> | 2021-04-07 09:17:19 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2021-04-08 15:06:12 +0000 |
| commit | c75e8619663efc4d97ab13fb35f815104239dd36 (patch) | |
| tree | 06c85dae716a3947aaa6e50a648ef81237f290f7 /addons/test_mail | |
| parent | 51700491ae3b26d513ddfeda378a60592fca6eab (diff) | |
[IMP] event, mail, mass_mailing, sms, test_mail: clean some mail tests tools helpers and parameters
In this commit we backport some of 14.1+ improvements done in mail tools
in order to keep a coherent definition through sub versions. We also
improve docstring and add some explanations on available toold and asserts.
Task ID-2500615
COM PR odoo/odoo#68874
Diffstat (limited to 'addons/test_mail')
| -rw-r--r-- | addons/test_mail/tests/test_mail_channel.py | 4 | ||||
| -rw-r--r-- | addons/test_mail/tests/test_mail_composer.py | 5 | ||||
| -rw-r--r-- | addons/test_mail/tests/test_message_post.py | 10 |
3 files changed, 10 insertions, 9 deletions
diff --git a/addons/test_mail/tests/test_mail_channel.py b/addons/test_mail/tests/test_mail_channel.py index 3fec6b8594c..239e76ccb41 100644 --- a/addons/test_mail/tests/test_mail_channel.py +++ b/addons/test_mail/tests/test_mail_channel.py @@ -8,6 +8,7 @@ from odoo.exceptions import AccessError, ValidationError, UserError from odoo.tools import mute_logger, formataddr +@tagged('mail_channel') class TestChannelAccessRights(TestMailCommon): @classmethod @@ -107,6 +108,7 @@ class TestChannelAccessRights(TestMailCommon): trigger_read = partner.with_user(self.user_portal).name +@tagged('mail_channel') class TestChannelFeatures(TestMailCommon): @classmethod @@ -348,7 +350,7 @@ class TestChannelFeatures(TestMailCommon): self.assertTrue(initial_channel_info, 'should be able to chat with multi company user') -@tagged('moderation') +@tagged('moderation', 'mail_channel') class TestChannelModeration(TestMailCommon): @classmethod diff --git a/addons/test_mail/tests/test_mail_composer.py b/addons/test_mail/tests/test_mail_composer.py index e22a875a5a6..0547caca98d 100644 --- a/addons/test_mail/tests/test_mail_composer.py +++ b/addons/test_mail/tests/test_mail_composer.py @@ -520,7 +520,6 @@ class TestComposerResultsComment(TestMailComposer): # template is sent only to partners (email_to are transformed) message = self.test_record.message_ids[0] self.assertMailMail(self.partner_employee_2, 'sent', - check_mail_mail=True, mail_message=message, author=self.partner_employee, # author != email_from (template sets only email_from) email_values={ @@ -536,7 +535,6 @@ class TestComposerResultsComment(TestMailComposer): fields_values={}, ) self.assertMailMail(self.test_record.customer_id + new_partners, 'sent', - check_mail_mail=True, mail_message=message, author=self.partner_employee, # author != email_from (template sets only email_from) email_values={ @@ -597,7 +595,7 @@ class TestComposerResultsMass(TestMailComposer): message = record.message_ids[0] # template is sent directly using customer field, meaning we have recipients - self.assertMailMail(record.customer_id, 'sent', check_mail_mail=True, + self.assertMailMail(record.customer_id, 'sent', mail_message=message, author=self.partner_employee) @@ -668,7 +666,6 @@ class TestComposerResultsMass(TestMailComposer): self._mails = _mails self.assertMailMail(record.customer_id + new_partners + self.partner_admin, 'sent', - check_mail_mail=True, mail_message=message, author=self.partner_employee, email_values={ diff --git a/addons/test_mail/tests/test_message_post.py b/addons/test_mail/tests/test_message_post.py index 09370bd9ade..129406567e5 100644 --- a/addons/test_mail/tests/test_message_post.py +++ b/addons/test_mail/tests/test_message_post.py @@ -113,10 +113,12 @@ class TestMessagePost(TestMailCommon, TestRecipients): # subscribe second employee to the group to test notifications self.test_record.message_subscribe(partner_ids=[self.user_admin.partner_id.id]) - with self.assertSinglePostNotifications([ - {'partner': self.partner_1, 'type': 'email'}, - {'partner': self.partner_2, 'type': 'email'}, - {'partner': self.partner_admin, 'type': 'email'}], {'content': _body}, mail_unlink_sent=True): + with self.assertSinglePostNotifications( + [{'partner': self.partner_1, 'type': 'email'}, + {'partner': self.partner_2, 'type': 'email'}, + {'partner': self.partner_admin, 'type': 'email'}], + {'content': _body}, + mail_unlink_sent=True): msg = self.test_record.with_user(self.user_employee).message_post( body=_body, subject=_subject, message_type='comment', subtype_xmlid='mail.mt_comment', |
