diff --git a/addons/mail/tests/__init__.py b/addons/mail/tests/__init__.py index 413ea870c3c5191f85be6ba4c0f9927b7706cf30..1ff431bd6335b57f9849fc92f47eb70964be2838 100644 --- a/addons/mail/tests/__init__.py +++ b/addons/mail/tests/__init__.py @@ -10,3 +10,4 @@ import test_message_track import test_mail_template import test_invite import test_ir_actions +import test_update_notification diff --git a/addons/mail/tests/test_update_notification.py b/addons/mail/tests/test_update_notification.py new file mode 100644 index 0000000000000000000000000000000000000000..7621e4056a11d81bc7ebb247454811a77c74a713 --- /dev/null +++ b/addons/mail/tests/test_update_notification.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +from odoo.tests.common import TransactionCase + + +class TestUpdateNotification(TransactionCase): + def test_user_count(self): + ping_msg = self.env['publisher_warranty.contract'].with_context(active_test=False)._get_message() + user_count = self.env['res.users'].search_count([('active', '=', True)]) + self.assertEqual(ping_msg.get('nbr_users'), user_count, 'Update Notification: Users count is badly computed in ping message') + share_user_count = self.env['res.users'].search_count([('active', '=', True), ('share', '=', True)]) + self.assertEqual(ping_msg.get('nbr_share_users'), share_user_count, 'Update Notification: Portal Users count is badly computed in ping message')