summaryrefslogtreecommitdiff
path: root/addons/test_mass_mailing/tests/common.py
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2021-04-26 08:49:21 +0000
committerThibault Delavallée <tde@odoo.com>2021-04-27 09:15:43 +0000
commit4cf75bb1767fe7524c8e4d895d84ad2b56ef404d (patch)
tree199ee28b117b134cc6e23cd10582a53af298197d /addons/test_mass_mailing/tests/common.py
parent733411fe03b924832d6b10cadf93c8fc09cc5802 (diff)
[IMP] test_mass_mailing: improve test data management and test users, merge mailing tests
In this commit we try to simplify tests organization by * merging mailing_internals and mass_mailing tests, as they globally handle mailing-related tests (blacklist, opt-out, gateway update through replies and clicks); * move wizard (mailing.test) tests in their own file as they target a specific model; * add some loggers to reduce noise; * add some users wrappers to test using real users; Backport of odoo/odoo@230b8258a551010080dd582923afe5a2f91d644b done in master (14.4) LINKS Task ID-2117639 COM PR odoo/odoo#40931
Diffstat (limited to 'addons/test_mass_mailing/tests/common.py')
-rw-r--r--addons/test_mass_mailing/tests/common.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/addons/test_mass_mailing/tests/common.py b/addons/test_mass_mailing/tests/common.py
index 43b1ad27ea1..ff368bf59be 100644
--- a/addons/test_mass_mailing/tests/common.py
+++ b/addons/test_mass_mailing/tests/common.py
@@ -11,6 +11,13 @@ class TestMassMailCommon(MassMailCommon, TestMailCommon):
def setUpClass(cls):
super(TestMassMailCommon, cls).setUpClass()
+ cls.test_alias = cls.env['mail.alias'].create({
+ 'alias_name': 'test.alias',
+ 'alias_user_id': False,
+ 'alias_model_id': cls.env['ir.model']._get('mailing.test.simple').id,
+ 'alias_contact': 'everyone'
+ })
+
# 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({
@@ -32,6 +39,7 @@ class TestMassMailCommon(MassMailCommon, TestMailCommon):
</div>""",
'mailing_type': 'mail',
'mailing_model_id': cls.env['ir.model']._get('mailing.test.blacklist').id,
+ 'reply_to_mode': 'thread',
})
@classmethod