diff --git a/src/pypnusershub/tests/test_utilisateurs.py b/src/pypnusershub/tests/test_utilisateurs.py index 61adae8..d62fed8 100644 --- a/src/pypnusershub/tests/test_utilisateurs.py +++ b/src/pypnusershub/tests/test_utilisateurs.py @@ -52,12 +52,17 @@ def test_insert_user(self, app, organism, group_and_users, provider_instance): user_ = provider_instance.insert_or_update_role(user_dict) assert len(db.session.get(User, 99998).groups) == 2 - def test_insert_or_update_role_grp_reconcialiation(self, provider_instance): + def test_insert_or_update_role_grp_reconcialiation( + self, provider_instance, group_and_users + ): # test modification du local provider pour lui ajouter un group mapping # et un group_claim_name # provider_instance.configure(provider_config) provider_instance.group_claim_name = "provided_groups" - provider_instance.group_mapping = {"group1": 1, "group2": 2} + provider_instance.group_mapping = { + "group1": group_and_users["group1"], + "group2": group_and_users["group1"], + } user_to_reconcialite = { "id_role": 999998, @@ -72,7 +77,7 @@ def test_insert_or_update_role_grp_reconcialiation(self, provider_instance): ) user_group_id = map(lambda g: g.id_role, user.groups) - assert set(user_group_id) == {1, 2} + assert set(user_group_id) == {group_and_users["group1"]} def test_insert_organisme(self): organism = {