summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2015-07-28 15:08:00 +0200
committerChristophe Simonis <chs@odoo.com>2015-07-28 15:08:54 +0200
commitea5ee871d4e2bab349d4b665f61a4c6bf438d866 (patch)
tree25872ffe67e39370dba24b1d22e205026ef8fe18 /addons
parent8998b03b828a594886a3d2aff547f7e53736292d (diff)
[FIX] mail: adapt test introduced during previous forward-port
Diffstat (limited to 'addons')
-rw-r--r--addons/mail/tests/test_mail_gateway.py37
1 files changed, 14 insertions, 23 deletions
diff --git a/addons/mail/tests/test_mail_gateway.py b/addons/mail/tests/test_mail_gateway.py
index b2ded64b238..c9a0b8a277d 100644
--- a/addons/mail/tests/test_mail_gateway.py
+++ b/addons/mail/tests/test_mail_gateway.py
@@ -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)