Browse Source

[NEW][8.0] portal_welcome_email_template: Add test

pull/42/head
Sergio Incaser 9 years ago
parent
commit
4876c0e73b
  1. 6
      portal_welcome_email_template/tests/__init__.py
  2. 32
      portal_welcome_email_template/tests/test_portal_welcome_email_template.py

6
portal_welcome_email_template/tests/__init__.py

@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# (c) 2015 Incaser Informatica S.L. - Sergio Teruel
# (c) 2015 Incaser Informatica S.L. - Carlos Dauden
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import test_portal_welcome_email_template

32
portal_welcome_email_template/tests/test_portal_welcome_email_template.py

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
# (c) 2015 Incaser Informatica S.L. - Sergio Teruel
# (c) 2015 Incaser Informatica S.L. - Carlos Dauden
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp.tests.common import TransactionCase
class TestWelcomeEmailTemplate(TransactionCase):
def setUp(self):
super(TestWelcomeEmailTemplate, self).setUp()
self.partner_obj = self.env['res.partner']
self.partner = self.env.ref('base.res_partner_address_4')
self.wiz_portal_access = self.env['portal.wizard'].create({
'user_ids': [(0, 0, {
'partner_id': self.partner.id,
'in_portal': True,
})],
})
def test_send_mail(self):
self.wiz_portal_access.user_ids.action_apply()
portal_user = self.env['res.users'].search(
[('partner_id', '=', self.partner.id)])
self.assertTrue(portal_user)
mail = self.env['mail.mail'].search([
('model', '=', 'res.users'),
('res_id', '=', portal_user.id)
])
self.assertTrue(mail)
Loading…
Cancel
Save