From a5da7ac9a3ca1bdc82f8f8ed2e8afc23592fb286 Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Fri, 15 Sep 2023 19:52:18 +0200 Subject: [PATCH] [FIX] edi_oca: Adapt tests to changes on error messages --- edi_oca/tests/test_security.py | 16 ++++++++-------- edi_oca/views/edi_backend_views.xml | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/edi_oca/tests/test_security.py b/edi_oca/tests/test_security.py index 9aae81cd09..4d43ed092b 100644 --- a/edi_oca/tests/test_security.py +++ b/edi_oca/tests/test_security.py @@ -86,18 +86,18 @@ def test_group_create(self): def test_rule_no_create(self): self.user.write({"groups_id": [(4, self.group.id)]}) self.consumer_record.name = "no_rule" - with self.assertRaisesRegex(AccessError, "Exchange Record rule demo"): + with self.assertRaises(AccessError): self.create_record(self.user) @mute_logger("odoo.addons.base.models.ir_model") def test_no_group_no_create(self): - with self.assertRaisesRegex(AccessError, "You are not allowed to modify"): + with self.assertRaises(AccessError): self.create_record(self.user) @mute_logger("odoo.addons.base.models.ir_model") def test_no_group_no_read(self): exchange_record = self.create_record() - with self.assertRaisesRegex(AccessError, "You are not allowed to access"): + with self.assertRaises(AccessError): exchange_record.with_user(self.user).read() @mute_logger("odoo.addons.base.models.ir_rule") @@ -106,13 +106,13 @@ def test_rule_no_read(self): self.user.write({"groups_id": [(4, self.group.id)]}) self.assertTrue(exchange_record.with_user(self.user).read()) self.consumer_record.name = "no_rule" - with self.assertRaisesRegex(AccessError, "Exchange Record rule demo"): + with self.assertRaises(AccessError): exchange_record.with_user(self.user).read() @mute_logger("odoo.addons.base.models.ir_model") def test_no_group_no_unlink(self): exchange_record = self.create_record() - with self.assertRaisesRegex(AccessError, "You are not allowed to modify"): + with self.assertRaises(AccessError): exchange_record.with_user(self.user).unlink() @mute_logger("odoo.models.unlink") @@ -126,7 +126,7 @@ def test_rule_no_unlink(self): exchange_record = self.create_record() self.user.write({"groups_id": [(4, self.group.id)]}) self.consumer_record.name = "no_rule" - with self.assertRaisesRegex(AccessError, "Exchange Record rule demo"): + with self.assertRaises(AccessError): exchange_record.with_user(self.user).unlink() def test_no_group_no_search(self): @@ -197,7 +197,7 @@ def test_search_no_record_admin(self): @mute_logger("odoo.addons.base.models.ir_model") def test_no_group_no_write(self): exchange_record = self.create_record() - with self.assertRaisesRegex(AccessError, "You are not allowed to modify"): + with self.assertRaises(AccessError): exchange_record.with_user(self.user).write({"external_identifier": "1234"}) def test_group_write(self): @@ -211,5 +211,5 @@ def test_rule_no_write(self): exchange_record = self.create_record() self.user.write({"groups_id": [(4, self.group.id)]}) self.consumer_record.name = "no_rule" - with self.assertRaisesRegex(AccessError, "Exchange Record rule demo"): + with self.assertRaises(AccessError): exchange_record.with_user(self.user).write({"external_identifier": "1234"}) diff --git a/edi_oca/views/edi_backend_views.xml b/edi_oca/views/edi_backend_views.xml index 7c5a751c89..5c78b88f56 100644 --- a/edi_oca/views/edi_backend_views.xml +++ b/edi_oca/views/edi_backend_views.xml @@ -3,7 +3,7 @@ edi.backend - + @@ -12,7 +12,7 @@ edi.backend -
+