summaryrefslogtreecommitdiff
path: root/addons/test_mail/tests/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/test_mail/tests/common.py')
-rw-r--r--addons/test_mail/tests/common.py56
1 files changed, 6 insertions, 50 deletions
diff --git a/addons/test_mail/tests/common.py b/addons/test_mail/tests/common.py
index a1b7c7000ea..b62b1a444aa 100644
--- a/addons/test_mail/tests/common.py
+++ b/addons/test_mail/tests/common.py
@@ -1,63 +1,19 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from odoo.addons.mail.tests import common as mail_common
-from odoo.tests import common
+from odoo.addons.mail.tests.common import MailCommon
+from odoo.tests.common import SavepointCase
-mail_new_test_user = mail_common.mail_new_test_user
-
-class TestMailCommon(common.SavepointCase, mail_common.MailCase):
-
- @classmethod
- def setUpClass(cls):
- super(TestMailCommon, cls).setUpClass()
- # give default values for all email aliases and domain
- cls._init_mail_gateway()
- # ensure admin configuration
- cls.user_admin = cls.env.ref('base.user_admin')
- cls.user_admin.write({'notification_type': 'inbox'})
- cls.partner_admin = cls.env.ref('base.partner_admin')
- cls.company_admin = cls.user_admin.company_id
- cls.company_admin.write({'email': 'company@example.com'})
- # test standard employee
- cls.user_employee = mail_new_test_user(
- cls.env, login='employee', groups='base.group_user', company_id=cls.company_admin.id,
- name='Ernest Employee', notification_type='inbox', signature='--\nErnest')
- cls.partner_employee = cls.user_employee.partner_id
+class TestMailCommon(MailCommon):
+ """ Main entry point for functional tests. """
@classmethod
def _create_channel_listener(cls):
cls.channel_listen = cls.env['mail.channel'].with_context(cls._test_context).create({'name': 'Listener'})
- @classmethod
- def _create_portal_user(cls):
- cls.user_portal = mail_new_test_user(
- cls.env, login='portal_test', groups='base.group_portal', company_id=cls.company_admin.id,
- name='Chell Gladys', notification_type='email')
- cls.partner_portal = cls.user_portal.partner_id
- return cls.user_portal
-
- @classmethod
- def _create_template(cls, model, template_values=None):
- create_values = {
- 'name': 'TestTemplate',
- 'subject': 'About ${object.name}',
- 'body_html': '<p>Hello ${object.name}</p>',
- 'model_id': cls.env['ir.model']._get(model).id,
- }
- if template_values:
- create_values.update(template_values)
- cls.email_template = cls.env['mail.template'].create(create_values)
- return cls.email_template
-
- def flush_tracking(self):
- """ Force the creation of tracking values. """
- self.env['base'].flush()
- self.cr.precommit()
-
-class TestMailMultiCompanyCommon(TestMailCommon):
+class TestMailMultiCompanyCommon(MailCommon):
@classmethod
def setUpClass(cls):
@@ -67,7 +23,7 @@ class TestMailMultiCompanyCommon(TestMailCommon):
})
-class TestRecipients(common.SavepointCase):
+class TestRecipients(SavepointCase):
@classmethod
def setUpClass(cls):