summaryrefslogtreecommitdiff
path: root/addons/test_mass_mailing/tests/common.py
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2018-10-01 11:13:49 +0200
committerThibault Delavallée <tde@odoo.com>2018-10-02 16:32:53 +0200
commitfca1654dc59cf1085c2d2fbe50bc25724bee17b4 (patch)
treedc93a4a866698339e503fffaae7474d73ace53c3 /addons/test_mass_mailing/tests/common.py
parent4b3884b0d74a2f65d0e185db2f1aaa274258caf3 (diff)
[ADD] test_mass_mailing: add module to hold feature and performance tests for mass mailing
Purpose of this commit is to add the skeleton of a module holding models and tests for mass mailing. It is build on top of test_mail in order to use data, models and parameters already defined in it. Moreover having a separate module allow to define test models that will not bloat production databases. It will soon hold unit tests for blacklist mechanism. Future commits will gradually move tests from mass mailing module and improve them. This commit is related to task ID 33224 (original blacklist implementation done for v12) and its PR #25966 as well as task ID 1889703 (tests and fixes) and its PR #27330. Done with collaboration of @dbeguin.
Diffstat (limited to 'addons/test_mass_mailing/tests/common.py')
-rw-r--r--addons/test_mass_mailing/tests/common.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/addons/test_mass_mailing/tests/common.py b/addons/test_mass_mailing/tests/common.py
new file mode 100644
index 00000000000..88a4ceb0735
--- /dev/null
+++ b/addons/test_mass_mailing/tests/common.py
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo.addons.test_mail.tests import common
+from odoo.tests import tagged
+
+
+@tagged('mass_mail')
+class MassMailingCase(common.MockEmails, common.BaseFunctionalTest):
+
+ @classmethod
+ def setUpClass(cls):
+ super(MassMailingCase, cls).setUpClass()
+
+ # be sure for some common data
+ cls.user_employee.write({
+ 'login': 'emp',
+ })
+
+ cls.user_marketing = cls.env['res.users'].with_context(cls._quick_create_user_ctx).create({
+ 'name': 'Ernest Employee',
+ 'login': 'marketing',
+ 'email': 'e.e@example.com',
+ 'signature': '--\nErnest',
+ 'notification_type': 'email',
+ 'groups_id': [
+ (6, 0, [cls.env.ref('base.group_user').id]),
+ (6, 0, [cls.env.ref('mass_mailing.group_mass_mailing_user').id])
+ ],
+ })