Skip to content

Commit

Permalink
[MIG] web_notify: Migrated in v17
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikul-OSI committed Feb 14, 2024
1 parent a185295 commit 7540664
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion web_notify/tests/test_res_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import json

from odoo import exceptions
from odoo import SUPERUSER_ID, exceptions
from odoo.tests import common

from ..models.res_users import DANGER, DEFAULT, INFO, SUCCESS, WARNING
Expand Down Expand Up @@ -84,6 +84,12 @@ def test_notify_other_user(self):
with self.assertRaises(exceptions.UserError):
other_user_model.browse(self.env.uid).notify_info(message="hello")

def test_notify_sudo_user(self):
other_user = self.env.ref("base.user_demo")
other_user_model = self.env["res.users"].with_user(other_user)
with self.assertRaises(exceptions.UserError):
other_user_model.browse(SUPERUSER_ID).notify_info(message="hello")

def test_notify_admin_allowed_other_user(self):
other_user = self.env.ref("base.user_demo")
other_user.notify_info(message="hello")

0 comments on commit 7540664

Please sign in to comment.