Files
odoo_source/addons/im_livechat/tests/common.py
T
std-odoo f42cdf1e23 [FIX] im_livechat: fix the session duration
Bug
===
The session duration added in the KPI have the wrong
value because of a typo in the SQL query.

Task-2827996

closes odoo/odoo#116169

X-original-commit: 1709c82f33e77f7482f323c4f86b2a8c4b6c5c0d
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-03-22 14:52:33 +01:00

49 lines
1.4 KiB
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import TransactionCase
class TestImLivechatCommon(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.operators = cls.env['res.users'].create([{
'name': 'Michel',
'login': 'michel',
'livechat_username': "Michel Operator",
'email': 'michel@example.com',
}, {
'name': 'Paul',
'login': 'paul'
}, {
'name': 'Pierre',
'login': 'pierre'
}, {
'name': 'Jean',
'login': 'jean'
}, {
'name': 'Georges',
'login': 'georges'
}])
cls.visitor_user = cls.env['res.users'].create({
'name': 'Rajesh',
'login': 'rajesh',
'country_id': cls.env.ref('base.in').id,
'email': 'rajesh@example.com',
})
cls.livechat_channel = cls.env['im_livechat.channel'].create({
'name': 'The channel',
'user_ids': [(6, 0, cls.operators.ids)]
})
def setUp(self):
super().setUp()
def get_available_users(_):
return self.operators
self.patch(type(self.env['im_livechat.channel']), '_get_available_users', get_available_users)