mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG] web_notify: Migration to 12.0
Add self-test buttons in demo environment, Updated readme to show how to test it. Add buttons to users form Do not rely on SUPERUSER_ID and avoid getattr usage
This commit is contained in:
@@ -1 +1,3 @@
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import test_res_users
|
||||
|
||||
@@ -43,7 +43,7 @@ class TestResUsers(common.TransactionCase):
|
||||
) as mockedSendMany:
|
||||
users = self.env.user.search([(1, "=", 1)])
|
||||
self.assertTrue(len(users) > 1)
|
||||
users.notify_warning('message')
|
||||
users.notify_warning(message='message')
|
||||
|
||||
self.assertEqual(1, mockedSendMany.call_count)
|
||||
|
||||
@@ -61,8 +61,8 @@ class TestResUsers(common.TransactionCase):
|
||||
other_user = self.env.ref('base.user_demo')
|
||||
other_user_model = self.env['res.users'].sudo(other_user)
|
||||
with self.assertRaises(exceptions.UserError):
|
||||
other_user_model.browse(self.env.uid).notify_info('hello')
|
||||
other_user_model.browse(self.env.uid).notify_info(message='hello')
|
||||
|
||||
def test_notify_admin_allowed_other_user(self):
|
||||
other_user = self.env.ref('base.user_demo')
|
||||
other_user.notify_info('hello')
|
||||
other_user.notify_info(message='hello')
|
||||
|
||||
Reference in New Issue
Block a user