summaryrefslogtreecommitdiff
path: root/addons/test_mail/tests/test_discuss.py
diff options
context:
space:
mode:
authorXavier-Do <xdo@odoo.com>2019-04-12 13:21:18 +0000
committerThibault Delavallée <tde@odoo.com>2019-05-29 13:34:32 +0000
commitde7c119e666d108564b3889d1c08e5bf2e4da082 (patch)
tree3c24844df7072ba840d93fb1f2b141ad7a507fa3 /addons/test_mail/tests/test_discuss.py
parent2fcb3c658df3e504b92ff9b5a805d150cfa7effd (diff)
[IMP] mail: reduce message_post query count and clean code
Purpose of this commit is to improve performance of post and notify through various code improvements. Containing * making of _notify_customize_recipients a mail.thread method; * _message_auto_subscribe_followers optimized; * renaming and optimisation of _notify_partners; * message_post_attachements optization; * remove unused mail_post_autofollow_partner_ids context key; * minimize message create queries; * only check record related access right for thread messages not in pending moderation; * get attachements from values instead of db; * storing lang in ctx from the beginning; * don't track on write on attachments; Related to task 1943901 Linked to PR #32404
Diffstat (limited to 'addons/test_mail/tests/test_discuss.py')
-rw-r--r--addons/test_mail/tests/test_discuss.py7
1 files changed, 0 insertions, 7 deletions
diff --git a/addons/test_mail/tests/test_discuss.py b/addons/test_mail/tests/test_discuss.py
index a14b10ffdd6..3cb885b715c 100644
--- a/addons/test_mail/tests/test_discuss.py
+++ b/addons/test_mail/tests/test_discuss.py
@@ -28,13 +28,6 @@ class TestChatterTweaks(BaseFunctionalTest, TestRecipients):
self.assertEqual(self.test_record.message_follower_ids.mapped('partner_id'), original.mapped('partner_id') | self.partner_1 | self.partner_2)
self.assertEqual(self.test_record.message_follower_ids.mapped('channel_id'), original.mapped('channel_id'))
- def test_post_subscribe_recipients_partial(self):
- original = self.test_record.message_follower_ids
- self.test_record.sudo(self.user_employee).with_context({'mail_create_nosubscribe': True, 'mail_post_autofollow': True, 'mail_post_autofollow_partner_ids': [self.partner_2.id]}).message_post(
- body='Test Body', message_type='comment', subtype='mt_comment', partner_ids=[self.partner_1.id, self.partner_2.id])
- self.assertEqual(self.test_record.message_follower_ids.mapped('partner_id'), original.mapped('partner_id') | self.partner_2)
- self.assertEqual(self.test_record.message_follower_ids.mapped('channel_id'), original.mapped('channel_id'))
-
def test_chatter_mail_create_nolog(self):
""" Test disable of automatic chatter message at create """
rec = self.env['mail.test.simple'].sudo(self.user_employee).with_context({'mail_create_nolog': True}).create({'name': 'Test'})