[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) <vfe@odoo.com>
This commit is contained in:
Victor Feyens
2022-10-25 13:03:41 +02:00
parent e885885d74
commit ba5678b441
@@ -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)