From ba5678b441a0c3efd5314182443c0d656ecb9a8d Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Tue, 18 Oct 2022 14:30:27 +0000 Subject: [PATCH] [FIX] base: resurrect lost test coverage Since #98551, groups have been moved from views fields to xml content to harmonize the behavior of xml and view groups. Nevertheless, this reduced the coverage of the test verifying settings user are always able to open the settings view. This commit brings back part of that coverage, checking for each application manager group that the settings view can be opened and saved correctly. closes odoo/odoo#103989 X-original-commit: bb067f894a5e5511370990b98981e739565d2f2a Signed-off-by: Victor Feyens (vfe) --- odoo/addons/base/tests/test_res_config.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/odoo/addons/base/tests/test_res_config.py b/odoo/addons/base/tests/test_res_config.py index 1829a02330a..fd006d3d9cb 100644 --- a/odoo/addons/base/tests/test_res_config.py +++ b/odoo/addons/base/tests/test_res_config.py @@ -127,6 +127,15 @@ class TestResConfigExecute(TransactionCase): ('model', '=', 'res.config.settings'), ]).groups_id + # Semi hack to recover part of the coverage lost when the groups_id + # were moved from the views records to the view nodes (with groups attributes) + groups_data = self.env['res.groups'].get_groups_by_application() + for group_data in groups_data: + if group_data[1] == 'selection' and group_data[3] != (100, 'Other'): + manager_group = group_data[2][-1] + settings_view_conditional_groups += manager_group + settings_view_conditional_groups -= group_system # Already tested above + for group in settings_view_conditional_groups: group_name = group.full_name _logger.info("Testing settings access for group %s", group_name)