Skip to content
Permalink
Browse files

mergeup: mail test fcommon

  • Loading branch information...
tde-banana-odoo committed Oct 25, 2019
1 parent eddf3e7 commit 5e0efc833d3aac393379125a02a44256f08caff5
Showing with 5 additions and 4 deletions.
  1. +5 −4 addons/mail/tests/common.py
@@ -305,12 +305,13 @@ def _init_mock_mail(self):
# MAIL TOOLS
# ------------------------------------------------------------

def _add_messages(self, record, body_content, count=1, author=None, **kwargs):
@classmethod
def _add_messages(cls, record, body_content, count=1, author=None, **kwargs):
""" Helper: add #count messages in record history """
author = author if author else self.env.user.partner_id
author = author if author else cls.env.user.partner_id
if 'email_from' not in kwargs:
kwargs['email_from'] = author.email_formatted
subtype_id = kwargs.get('subtype_id', self.env.ref('mail.mt_comment').id)
subtype_id = kwargs.get('subtype_id', cls.env.ref('mail.mt_comment').id)

values = {
'model': record._name,
@@ -324,7 +325,7 @@ def _add_messages(self, record, body_content, count=1, author=None, **kwargs):
values, body='%s/%02d' % (body_content, counter))
for counter in range(count)]

return self.env['mail.message'].sudo().create(create_vals)
return cls.env['mail.message'].sudo().create(create_vals)

# ------------------------------------------------------------
# MAIL ASSERTS WRAPPERS

0 comments on commit 5e0efc8

Please sign in to comment.
You can’t perform that action at this time.