diff options
| author | Thibault Delavallée <tde@odoo.com> | 2021-04-08 14:41:56 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2021-04-08 15:06:28 +0000 |
| commit | cb648d20dfe949c71c1f50ebda822d32ec8c976f (patch) | |
| tree | b28d6a89bf78be052f867cff80708d53c80109c1 /addons/test_mass_mailing/tests | |
| parent | 070bec2f3a7a50c6fc8f104cf92a9416ebc001b8 (diff) | |
[IMP] mail, (test_)mass_mailing: also check sent emails if possible
When using assertMailMailWEmails custom assert we now check that a sent
mail.mail matches a sent email. It allows to have a complete check from
mailing traces to sent emails.
Task ID-2500615
COM PR odoo/odoo#68874
ENT PR odoo/enterprise#17558
Diffstat (limited to 'addons/test_mass_mailing/tests')
| -rw-r--r-- | addons/test_mass_mailing/tests/common.py | 4 | ||||
| -rw-r--r-- | addons/test_mass_mailing/tests/test_blacklist_behavior.py | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/addons/test_mass_mailing/tests/common.py b/addons/test_mass_mailing/tests/common.py index 84f04bb29b1..2a550878b12 100644 --- a/addons/test_mass_mailing/tests/common.py +++ b/addons/test_mass_mailing/tests/common.py @@ -14,7 +14,9 @@ class TestMassMailCommon(MassMailCommon, TestMailCommon): def setUpClass(cls): super(TestMassMailCommon, cls).setUpClass() - cls.mailing_bl = cls.env['mailing.mailing'].create({ + # enforce last update by user_marketing to match _process_mass_mailing_queue + # taking last writer as user running a batch + cls.mailing_bl = cls.env['mailing.mailing'].with_user(cls.user_marketing).create({ 'name': 'SourceName', 'subject': 'MailingSubject', 'body_html': '<p>Hello ${object.name}</p>', diff --git a/addons/test_mass_mailing/tests/test_blacklist_behavior.py b/addons/test_mass_mailing/tests/test_blacklist_behavior.py index aa513d2a389..e07bfff760c 100644 --- a/addons/test_mass_mailing/tests/test_blacklist_behavior.py +++ b/addons/test_mass_mailing/tests/test_blacklist_behavior.py @@ -35,7 +35,8 @@ class TestAutoBlacklist(common.TestMassMailCommon): self.assertMailTraces( [{'email': 'test.record.00@test.example.com'}], - mailing, target, check_mail=True + mailing, target, + check_mail=True ) # call bounced |
