[IMP]improve test case

bzr revid: sgo@tinyerp.com-20120905053031-dqtcfyr1na9j7zpk
This commit is contained in:
Sanjay Gohel (Open ERP)
2012-09-05 11:00:31 +05:30
parent 43c71f585e
commit ef747c7143
+2 -2
View File
@@ -566,10 +566,10 @@ class test_mail(common.TransactionCase):
_mail_bodyalt2 = 'Pigs rules\nAdmin\n'
filter_subtype_id = self.mail_message_subtype.search(cr, uid, [('default','=',True)])
# Post comment with body and subject, comment preference
msg_id = self.mail_group.message_post(cr, uid, [self.group_pigs_id], body=_body1, subject=_subject, msg_type='comment',subtype='email')
msg_id = self.mail_group.message_post(cr, uid, [self.group_pigs_id], body=_body1, subject=_subject, type='comment',subtype='email')
notif_ids = self.mail_notification.search(cr, uid, [('message_id', '=', msg_id)])
self.assertTrue(len(notif_ids) >= 1,"subtype is email and show notification on wall")
# New post: test automatic subject, signature in html, add a partner, email preference, parent_id previous message
msg_id2 = self.mail_group.message_post(cr, uid, [self.group_pigs_id], body=_body2,subject=_subject, msg_type='email', subtype='other')
msg_id2 = self.mail_group.message_post(cr, uid, [self.group_pigs_id], body=_body2,subject=_subject, type='email', subtype='other')
notif_ids2 = self.mail_notification.search(cr, uid, [('message_id', '=', msg_id2)])
self.assertTrue(len(notif_ids2) == 0,"subtype is false cannot show notification on wall")