summaryrefslogtreecommitdiff
path: root/addons/mail/tests/test_update_notification.py
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2020-04-21 14:07:55 +0000
committerThibault Delavallée <tde@odoo.com>2020-04-22 08:00:29 +0000
commit6e347b196d4bf40929d88ab2c835ba3fbc4dac7d (patch)
tree6da6e12e60a81d792c9fb16933be9cb0f58dcd1a /addons/mail/tests/test_update_notification.py
parent1b4767ee798562911922a7e03b04b4e6485350be (diff)
[MOV] (test_)mail(_full): redispatch some tests and split test mail models file
PURPOSE Have a cleaner test_mail addons SPECIFICATIONS Keep only mail-related tests, move odoobot in test mail full, send "update notification" tests in mail (specific to mail). Merge some test files to lessen number of files, perform light file renaming. Split test mail models file to prepare some cleaning in those models and tests. LINKS Prepares Task ID 2238597 (clean notification models) Prepares Task ID 2083854 (improve mass mailing technical flows) PR #49891
Diffstat (limited to 'addons/mail/tests/test_update_notification.py')
-rw-r--r--addons/mail/tests/test_update_notification.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/addons/mail/tests/test_update_notification.py b/addons/mail/tests/test_update_notification.py
new file mode 100644
index 00000000000..7621e4056a1
--- /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')