Skip to content

Commit

Permalink
[17.0][FIX] base_user_role: Group synchronization fix for auditlog in…
Browse files Browse the repository at this point in the history
…tegration tests
  • Loading branch information
Mohssin Bouktaib committed Jan 28, 2025
1 parent 908beda commit afea8cd
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions base_user_role/tests/test_user_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def test_role_unlink(self):
]
}
)
self.user_id.set_groups_from_roles(force=True)
# Check user has groups from role1 and role2
self.assertLessEqual(role1_groups, self.user_id.groups_id)
self.assertLessEqual(role2_groups, self.user_id.groups_id)
Expand Down Expand Up @@ -182,6 +183,7 @@ def test_role_line_unlink(self):
]
}
)
self.user_id.set_groups_from_roles(force=True)
# Check user has groups from role1 and role2
self.assertLessEqual(role1_groups, self.user_id.groups_id)
self.assertLessEqual(role2_groups, self.user_id.groups_id)
Expand Down Expand Up @@ -274,16 +276,9 @@ def test_group_groups_into_role(self):
)
res = wizard.create_role()
# Check that a role with name: Test Role has been created
<<<<<<< HEAD
new_role = self.env[res["res_model"]].browse(res["res_id"])
self.assertEqual(new_role.name, "Test Role")
# Check that the role has the correct groups (even if the order is not equal)
self.assertEqual(set(new_role.implied_ids.ids), set(user_group_ids))
=======
new_role = self.role_model.search([("name", "=", "Test Role")])
self.assertTrue(new_role)
# Check that the role has the correct groups
self.assertEqual(
sorted(set(new_role.implied_ids.ids)), sorted(set(user_group_ids))
)
>>>>>>> 43458cb ([17.0][FIX] base_user_role: Group synchronization fix for auditlog integration tests)

0 comments on commit afea8cd

Please sign in to comment.