mirror of https://github.com/OCA/social.git
[FIX] don't break when a partner has a user
parent
dabb3bb7ff
commit
4168930283
|
@ -68,3 +68,7 @@ class MailNotification(models.Model):
|
|||
)
|
||||
for a in etree.HTML(link_html or '<html/>').xpath('//a[@href]'):
|
||||
this.record_access_link = a.get('href')
|
||||
|
||||
@api.model
|
||||
def _get_access_link(self, mail, partner):
|
||||
return self.env['mail.thread']._get_access_link(mail, partner)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# © 2016 Therp BV <http://therp.nl>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
from mock import patch
|
||||
from openerp.tests.common import TransactionCase
|
||||
|
||||
|
||||
|
@ -22,3 +23,9 @@ class TestMailNotificationEmailTemplate(TransactionCase):
|
|||
self.assertTrue(notifications)
|
||||
# check that our template was used
|
||||
self.assertTrue('<h2>Dear ' in n.body for n in notifications)
|
||||
# check we can actually send our mail
|
||||
with patch.object(
|
||||
self.env['ir.mail_server'].__class__, 'send_email'
|
||||
) as mock_send_email:
|
||||
notifications.send()
|
||||
mock_send_email.assert_called()
|
||||
|
|
Loading…
Reference in New Issue