[REF] test_mass_mailing: use odoo test helper method to create test users

Purpose of this commit is to use the newly introduced helper to create
test users in a quick way and reduce code duplication.

This commit is linked to task ID 1889703 and PR #27526.
This commit is contained in:
Thibault Delavallée
2018-10-18 13:57:02 +00:00
parent dc2ade763a
commit 397434a75d
+5 -11
View File
@@ -2,6 +2,7 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.test_mail.tests import common
from odoo.addons.test_mail.tests.common import mail_new_test_user
from odoo.tests import tagged
@@ -17,14 +18,7 @@ class MassMailingCase(common.MockEmails, common.BaseFunctionalTest):
'login': 'emp',
})
cls.user_marketing = cls.env['res.users'].with_context(cls._create_context('res.users')).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])
],
})
cls.user_marketing = mail_new_test_user(
cls.env, login='marketing',
groups='base.group_user,mass_mailing.group_mass_mailing_user',
name='Martial Marketing', signature='--\nMartial')