From f36dd4c891710bb3ddb6e097f80ef0b9b6c26134 Mon Sep 17 00:00:00 2001 From: "Amit Patel (OpenERP)" Date: Thu, 6 Sep 2012 16:29:14 +0530 Subject: [PATCH] [IMP]:improved test case bzr revid: apa@tinyerp.com-20120906105914-iwoi15ghgtibt2lr --- addons/mail/data/mail_data.xml | 5 ++++- addons/mail/mail_thread.py | 2 +- addons/mail/tests/test_mail.py | 4 +--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/mail/data/mail_data.xml b/addons/mail/data/mail_data.xml index b241cb095de..80aff038dac 100644 --- a/addons/mail/data/mail_data.xml +++ b/addons/mail/data/mail_data.xml @@ -15,13 +15,16 @@ other - + + email + comment + diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 4d627712742..42581654ace 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -562,7 +562,7 @@ class mail_thread(osv.AbstractModel): self.message_post(cr, uid, [id], message, context=context) def message_post(self, cr, uid, thread_id, body='', subject=False, - type='notification', parent_id=False, attachments=None, subtype='other', context=None, **kwargs): + type='notification', parent_id=False, attachments=None, subtype='comment', context=None, **kwargs): """ Post a new message in an existing thread, returning the new mail.message ID. Extra keyword arguments will be used as default column values for the new mail.message record. diff --git a/addons/mail/tests/test_mail.py b/addons/mail/tests/test_mail.py index a8c1d6b7cf1..8cf0e25ecbb 100644 --- a/addons/mail/tests/test_mail.py +++ b/addons/mail/tests/test_mail.py @@ -616,9 +616,7 @@ class test_mail(common.TransactionCase): # 0 - Admin p_a_id = user_admin.partner_id.id # Subscribe #1, - self.mail_group_model_id = self.ir_model.search(cr, uid, [('model','=', 'mail.group')])[0] - subtype_ids = self.mail_message_subtype.search(cr, uid, []) - self.mail_message_subtype.write(cr,uid,subtype_ids,{'model_ids':[(4,self.mail_group_model_id )]}) + group_pigs.message_subscribe_users([uid]) # Mail data