Skip to content

Commit e0cbb05

Browse files
committed
[IMP] mail: add basic for update notification (ping)
Ensures no regression on a3509d2
1 parent 106840c commit e0cbb05

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

addons/mail/tests/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
import test_mail_template
1111
import test_invite
1212
import test_ir_actions
13+
import test_update_notification
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# -*- coding: utf-8 -*-
2+
from odoo.tests.common import TransactionCase
3+
4+
5+
class TestUpdateNotification(TransactionCase):
6+
def test_user_count(self):
7+
ping_msg = self.env['publisher_warranty.contract'].with_context(active_test=False)._get_message()
8+
user_count = self.env['res.users'].search_count([('active', '=', True)])
9+
self.assertEqual(ping_msg.get('nbr_users'), user_count, 'Update Notification: Users count is badly computed in ping message')
10+
share_user_count = self.env['res.users'].search_count([('active', '=', True), ('share', '=', True)])
11+
self.assertEqual(ping_msg.get('nbr_share_users'), share_user_count, 'Update Notification: Portal Users count is badly computed in ping message')

0 commit comments

Comments
 (0)