Skip to content
Snippets Groups Projects
Commit 03a13e93 authored by Xavier Morel's avatar Xavier Morel
Browse files

[IMP] base, test_access_rights: mute ir_rule logging on ACL tests

The tests are willfully triggering ACL failures, logging the
information is noisy and not useful.
parent 884bcdd3
No related branches found
No related tags found
No related merge requests found
...@@ -39,7 +39,7 @@ class TestORM(TransactionCase): ...@@ -39,7 +39,7 @@ class TestORM(TransactionCase):
with self.assertRaises(MissingError): with self.assertRaises(MissingError):
p1.write({'name': 'foo'}) p1.write({'name': 'foo'})
@mute_logger('odoo.models') @mute_logger('odoo.models', 'odoo.addons.base.models.ir_rule')
def test_access_filtered_records(self): def test_access_filtered_records(self):
""" Verify that accessing filtered records works as expected for non-admin user """ """ Verify that accessing filtered records works as expected for non-admin user """
p1 = self.env['res.partner'].create({'name': 'W'}) p1 = self.env['res.partner'].create({'name': 'W'})
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
from odoo.exceptions import AccessError from odoo.exceptions import AccessError
from odoo.tests.common import TransactionCase from odoo.tests.common import TransactionCase
from odoo.tools import mute_logger
class TestRules(TransactionCase): class TestRules(TransactionCase):
def setUp(self): def setUp(self):
...@@ -28,6 +30,7 @@ class TestRules(TransactionCase): ...@@ -28,6 +30,7 @@ class TestRules(TransactionCase):
'domain_force': "[('categ_id', 'in', user.env['test_access_right.obj_categ'].search([]).ids)]" 'domain_force': "[('categ_id', 'in', user.env['test_access_right.obj_categ'].search([]).ids)]"
}) })
@mute_logger('odoo.addons.base.models.ir_rule')
def test_basic_access(self): def test_basic_access(self):
env = self.env(user=self.browse_ref('base.public_user')) env = self.env(user=self.browse_ref('base.public_user'))
...@@ -44,6 +47,7 @@ class TestRules(TransactionCase): ...@@ -44,6 +47,7 @@ class TestRules(TransactionCase):
with self.assertRaises(AccessError): with self.assertRaises(AccessError):
self.assertEqual(browse2.val, -1) self.assertEqual(browse2.val, -1)
@mute_logger('odoo.addons.base.models.ir_rule')
def test_group_rule(self): def test_group_rule(self):
env = self.env(user=self.browse_ref('base.public_user')) env = self.env(user=self.browse_ref('base.public_user'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment