[IMP] test_discuss_full: prevent im_status being wrong when homeworking is installed

Homeworking changes the im_status of a partner if the employee is at the office
or not. So, im_status 'online' would become 'office_online' so that we can show
different icons to highlight that a person is at the office or at home. Since
the tests in test_discuss_full expect specifically 'online', it made the tests
fail. If we make the assertion using the partner's im_status, it prevents the
test from failing while keeping its value.

task-3527196

Part-of: odoo/odoo#137502
This commit is contained in:
Leonardo Pavan Rocha
2023-10-12 16:12:04 +00:00
parent e9331147ff
commit 3d61afeb60
@@ -12,7 +12,7 @@ from odoo.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
@tagged('post_install', '-at_install')
class TestDiscussFullPerformance(HttpCase):
_query_count = 72
_query_count = 73
def setUp(self):
super().setUp()
@@ -147,7 +147,7 @@ class TestDiscussFullPerformance(HttpCase):
'active': True,
'email': 'e.e@example.com',
'id': self.users[0].partner_id.id,
'im_status': 'online',
'im_status': self.users[0].partner_id.im_status,
'is_company': False,
'name': 'Ernest Employee',
'out_of_office_date_end': False,
@@ -198,7 +198,7 @@ class TestDiscussFullPerformance(HttpCase):
'active': True,
'email': 'e.e@example.com',
'id': self.users[0].partner_id.id,
'im_status': 'online',
'im_status': self.users[0].partner_id.im_status,
'is_company': False,
'name': 'Ernest Employee',
'out_of_office_date_end': False,
@@ -249,7 +249,7 @@ class TestDiscussFullPerformance(HttpCase):
'active': True,
'email': 'e.e@example.com',
'id': self.users[0].partner_id.id,
'im_status': 'online',
'im_status': self.users[0].partner_id.im_status,
'is_company': False,
'name': 'Ernest Employee',
'out_of_office_date_end': False,
@@ -300,7 +300,7 @@ class TestDiscussFullPerformance(HttpCase):
'active': True,
'email': 'e.e@example.com',
'id': self.users[0].partner_id.id,
'im_status': 'online',
'im_status': self.users[0].partner_id.im_status,
'is_company': False,
'name': 'Ernest Employee',
'out_of_office_date_end': False,
@@ -351,7 +351,7 @@ class TestDiscussFullPerformance(HttpCase):
'active': True,
'email': 'e.e@example.com',
'id': self.users[0].partner_id.id,
'im_status': 'online',
'im_status': self.users[0].partner_id.im_status,
'is_company': False,
'name': 'Ernest Employee',
'out_of_office_date_end': False,
@@ -403,7 +403,7 @@ class TestDiscussFullPerformance(HttpCase):
'active': True,
'email': 'e.e@example.com',
'id': self.users[0].partner_id.id,
'im_status': 'online',
'im_status': self.users[0].partner_id.im_status,
'is_company': False,
'name': 'Ernest Employee',
'out_of_office_date_end': False,
@@ -423,7 +423,7 @@ class TestDiscussFullPerformance(HttpCase):
'active': True,
'email': False,
'id': self.users[12].partner_id.id,
'im_status': 'offline',
'im_status': self.users[12].partner_id.im_status,
'is_company': False,
'name': 'test12',
'out_of_office_date_end': False,
@@ -490,7 +490,7 @@ class TestDiscussFullPerformance(HttpCase):
'active': True,
'email': 'e.e@example.com',
'id': self.users[0].partner_id.id,
'im_status': 'online',
'im_status': self.users[0].partner_id.im_status,
'is_company': False,
'name': 'Ernest Employee',
'out_of_office_date_end': False,
@@ -510,7 +510,7 @@ class TestDiscussFullPerformance(HttpCase):
'active': True,
'email': False,
'id': self.users[14].partner_id.id,
'im_status': 'offline',
'im_status': self.users[14].partner_id.im_status,
'is_company': False,
'name': 'test14',
'out_of_office_date_end': False,
@@ -577,7 +577,7 @@ class TestDiscussFullPerformance(HttpCase):
'active': True,
'email': 'e.e@example.com',
'id': self.users[0].partner_id.id,
'im_status': 'online',
'im_status': self.users[0].partner_id.im_status,
'is_company': False,
'name': 'Ernest Employee',
'out_of_office_date_end': False,
@@ -597,7 +597,7 @@ class TestDiscussFullPerformance(HttpCase):
'active': True,
'email': False,
'id': self.users[15].partner_id.id,
'im_status': 'offline',
'im_status': self.users[15].partner_id.im_status,
'is_company': False,
'name': 'test15',
'out_of_office_date_end': False,
@@ -664,7 +664,7 @@ class TestDiscussFullPerformance(HttpCase):
'active': True,
'email': 'e.e@example.com',
'id': self.users[0].partner_id.id,
'im_status': 'online',
'im_status': self.users[0].partner_id.im_status,
'is_company': False,
'name': 'Ernest Employee',
'out_of_office_date_end': False,
@@ -684,7 +684,7 @@ class TestDiscussFullPerformance(HttpCase):
'active': True,
'email': 'test2@example.com',
'id': self.users[2].partner_id.id,
'im_status': 'offline',
'im_status': self.users[2].partner_id.im_status,
'is_company': False,
'name': 'test2',
'out_of_office_date_end': False,
@@ -751,7 +751,7 @@ class TestDiscussFullPerformance(HttpCase):
'active': True,
'email': 'e.e@example.com',
'id': self.users[0].partner_id.id,
'im_status': 'online',
'im_status': self.users[0].partner_id.im_status,
'is_company': False,
'name': 'Ernest Employee',
'out_of_office_date_end': False,
@@ -771,7 +771,7 @@ class TestDiscussFullPerformance(HttpCase):
'active': True,
'email': False,
'id': self.users[3].partner_id.id,
'im_status': 'offline',
'im_status': self.users[3].partner_id.im_status,
'is_company': False,
'name': 'test3',
'out_of_office_date_end': False,
@@ -941,7 +941,7 @@ class TestDiscussFullPerformance(HttpCase):
'id': self.channel_livechat_2.channel_member_ids.filtered(lambda m: m.guest_id).id,
'persona': {
'id': self.channel_livechat_2.channel_member_ids.filtered(lambda m: m.guest_id).guest_id.id,
'im_status': 'offline',
'im_status': self.channel_livechat_2.channel_member_ids.filtered(lambda m: m.guest_id).guest_id.im_status,
'name': self.channel_livechat_2.channel_member_ids.filtered(lambda m: m.guest_id).guest_id.name,
'type': "guest",
},
@@ -1012,7 +1012,7 @@ class TestDiscussFullPerformance(HttpCase):
'active': True,
'email': 'e.e@example.com',
'id': self.users[0].partner_id.id,
'im_status': 'online',
'im_status': self.users[0].partner_id.im_status,
'is_company': False,
'name': 'Ernest Employee',
'out_of_office_date_end': False,