[FIX] mail: disable tests

mail.channel doesn't have the normal behavior of mail.thread,
but the test are based on mail.channel (which is thus a not so good idea).
res.partner is the other model available in mail module, implementing
 the correct behavior of mail.thread, but trigger AccessError. The tests
are commented from now, since TDE and I rewrite the test with a complete
 module dedicated to the test and implementing the expected behavior of a mail.thread.
This commit is contained in:
Jérome Maes
2015-09-01 21:04:33 +02:00
committed by Aaron Bohy
parent 58c9530311
commit f83f2d97d7
2 changed files with 21 additions and 13 deletions
+9 -7
View File
@@ -48,13 +48,15 @@ class TestMessagePost(TestMail):
self.assertEqual(self.group_pigs.message_follower_ids.mapped('partner_id'), original.mapped('partner_id'))
self.assertEqual(self.group_pigs.message_follower_ids.mapped('channel_id'), original.mapped('channel_id'))
@mute_logger('openerp.addons.mail.models.mail_mail')
def test_post_subscribe_author(self):
original = self.group_pigs.message_follower_ids
self.group_pigs.sudo(self.user_employee).message_post(
body='Test Body', message_type='comment', subtype='mt_comment')
self.assertEqual(self.group_pigs.message_follower_ids.mapped('partner_id'), original.mapped('partner_id') | self.user_employee.partner_id)
self.assertEqual(self.group_pigs.message_follower_ids.mapped('channel_id'), original.mapped('channel_id'))
# TODO : the author of a message post on mail.channel should not be added as follower
# @mute_logger('openerp.addons.mail.models.mail_mail')
# def test_post_subscribe_author(self):
# original = self.group_pigs.message_follower_ids
# self.group_pigs.sudo(self.user_employee).message_post(
# body='Test Body', message_type='comment', subtype='mt_comment')
# self.assertEqual(self.group_pigs.message_follower_ids.mapped('partner_id'), original.mapped('partner_id') | self.user_employee.partner_id)
# self.assertEqual(self.group_pigs.message_follower_ids.mapped('channel_id'), original.mapped('channel_id'))
@mute_logger('openerp.addons.mail.models.mail_mail')
def test_post_no_subscribe_recipients(self):
+12 -6
View File
@@ -291,8 +291,10 @@ class TestMailgateway(TestMail):
self.assertIn('Valid Lelitre <valid.lelitre@agrolait.com>', new_groups.message_ids[0].email_from,
'message_process: recognized email -> email_from')
self.assertEqual(new_groups.message_partner_ids, self.partner_1,
'message_process: recognized email -> added as follower')
# TODO : the author of a message post on mail.channel should not be added as follower
# FAIL ON recognized email -> added as follower')
# self.assertEqual(new_groups.message_partner_ids, self.partner_1,
# 'message_process: recognized email -> added as follower')
self.assertEqual(len(self._mails), 0,
'message_process: no bounce or notificatoin email should be sent with follower = author')
@@ -379,11 +381,15 @@ class TestMailgateway(TestMail):
'message_process: one email should have been generated')
self.assertIn('valid.lelitre@agrolait.com', self._mails[0].get('email_to')[0],
'message_process: email should be sent to Sylvie')
# TODO : the author of a message post on mail.channel should not be added as follower
# FAIL ON 'message_process: after reply, group should have 2 followers') ` AssertionError: res.partner(104,) != res.partner(104, 105) : message_process: after reply, group should have 2 followers
# Test: author (and not recipient) added as follower
self.assertEqual(self.group_public.message_partner_ids, self.partner_1 | self.partner_2,
'message_process: after reply, group should have 2 followers')
self.assertEqual(self.group_public.message_channel_ids, self.env['mail.channel'],
'message_process: after reply, group should have 2 followers (0 channels)')
# self.assertEqual(self.group_public.message_partner_ids, self.partner_1 | self.partner_2,
# 'message_process: after reply, group should have 2 followers')
# self.assertEqual(self.group_public.message_channel_ids, self.env['mail.channel'],
# 'message_process: after reply, group should have 2 followers (0 channels)')
@mute_logger('openerp.addons.mail.models.mail_thread', 'openerp.models')
def test_message_process_in_reply_to(self):