This commit is contained in:
2026-11-08 20:08:53 +08:00
parent 7526a5fe4d
commit 9b924747c5
2692 changed files with 394867 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import TransactionCase
class TestImLivechatChannel(TransactionCase):
def test_is_livechat_available(self):
ai_agent = self.env['ai.agent'].create({
'name': 'Test AI Agent',
})
channel_1 = self.env['im_livechat.channel'].create({
'name': 'Test Channel 1',
})
self.assertEqual(channel_1.ai_agent_count, 0)
self.assertEqual(channel_1._is_livechat_available(), False)
self.env['im_livechat.channel.rule'].create({
'channel_id': channel_1.id,
'ai_agent_id': ai_agent.id,
})
self.assertEqual(channel_1.ai_agent_count, 1)
self.assertEqual(channel_1._is_livechat_available(), True)