Skip to content
Snippets Groups Projects
Commit ea5ee871 authored by Christophe Simonis's avatar Christophe Simonis
Browse files

[FIX] mail: adapt test introduced during previous forward-port

parent 8998b03b
No related branches found
No related tags found
No related merge requests found
......@@ -577,29 +577,20 @@ class TestMailgateway(TestMail):
'message_post: private discussion: incorrect notified recipients when replying')
# Do bert forward it to an alias
mail_group_model_id = self.ir_model.search(cr, uid, [('model', '=', 'mail.group')])[0]
self.mail_alias.create(cr, uid, {
'alias_name': 'groups',
'alias_user_id': False,
'alias_model_id': mail_group_model_id,
'alias_parent_model_id': mail_group_model_id,
'alias_parent_thread_id': self.group_pigs_id,
'alias_contact': 'everyone'})
msg = self.mail_message.browse(cr, uid, msg1_id)
msg = self.env['mail.message'].browse(msg1.id)
# forward it to a new thread AND an existing thread
for i, to in enumerate(['groups', 'group+pigs']):
for i, to in enumerate(['groups', 'public']):
fw_msg_id = '<THIS.IS.A.FW.MESSAGE.%d@bert.fr>' % (i,)
fw_message = format(MAIL_TEMPLATE, to='%s@whatever.tld' % (to,),
subject='FW: Re: 1',
email_from='bert@bert.fr',
extra='References: %s' % msg.message_id,
msg_id=fw_msg_id)
self.mail_thread.message_process(cr, uid, None, fw_message)
msg_ids = self.mail_message.search(cr, uid, [('message_id', '=', fw_msg_id)])
self.assertEqual(len(msg_ids), 1)
msg_fw = self.mail_message.browse(cr, uid, msg_ids[0])
self.assertEqual(msg_fw.model, 'mail.group')
fw_message = MAIL_TEMPLATE.format(to='%s@example.com' % (to,),
cc='',
subject='FW: Re: 1',
email_from='b.t@example.com',
extra='References: %s' % msg.message_id,
msg_id=fw_msg_id)
self.env['mail.thread'].message_process(None, fw_message)
msg_fw = self.env['mail.message'].search([('message_id', '=', fw_msg_id)])
self.assertEqual(len(msg_fw), 1)
self.assertEqual(msg_fw.model, 'mail.channel')
self.assertFalse(msg_fw.parent_id)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment