diff options
| author | Priyanka Kakadiya <pka@odoo.com> | 2020-03-05 12:41:17 +0000 |
|---|---|---|
| committer | Sébastien Theys <seb@odoo.com> | 2020-10-29 11:40:08 +0000 |
| commit | cd02e4290a708f9141fcd19773b6f01b47507274 (patch) | |
| tree | b9d40847e70574f6e929c7422b7dfa1c19927b95 /addons/test_mail | |
| parent | 53899994142b927b9f2ba9c19010428195650878 (diff) | |
[IMP] test_mail: add test for multi company chat
this commit add a test case for the multi company chat.
LINKS:
PR https://github.com/odoo/odoo/pull/47398
Task 2207147
closes odoo/odoo#60973
X-original-commit: 143e418a2654e06bbe86a44c6ec40e07b32ee1c1
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Diffstat (limited to 'addons/test_mail')
| -rw-r--r-- | addons/test_mail/tests/test_mail_channel.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/addons/test_mail/tests/test_mail_channel.py b/addons/test_mail/tests/test_mail_channel.py index 42fba8eeee4..168bf51c760 100644 --- a/addons/test_mail/tests/test_mail_channel.py +++ b/addons/test_mail/tests/test_mail_channel.py @@ -283,6 +283,25 @@ class TestChannelFeatures(TestMailCommon): "Last message id should stay the same after mark channel as seen with an older message" ) + def test_multi_company_chat(self): + company_A = self.env['res.company'].create({'name': 'Company A'}) + company_B = self.env['res.company'].create({'name': 'Company B'}) + test_user_1 = self.env['res.users'].create({ + 'login': 'user1', + 'name': 'My First New User', + 'company_ids': [(6, 0, company_A.ids)], + 'company_id': company_A.id + }) + test_user_2 = self.env['res.users'].create({ + 'login': 'user2', + 'name': 'My Second New User', + 'company_ids': [(6, 0, company_B.ids)], + 'company_id': company_B.id + }) + initial_channel_info = self.env['mail.channel'].with_user(test_user_1).with_context(allowed_company_ids=company_A.ids).channel_get(test_user_2.partner_id.ids) + self.assertTrue(initial_channel_info, 'should be able to chat with multi company user') + + @tagged('moderation') class TestChannelModeration(TestMailCommon): |
