Skip to content

Commit

Permalink
fixup! test and refacto
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoLechemia committed Jul 16, 2024
1 parent 21c6f4b commit 6d5d633
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/pypnusershub/tests/test_utilisateurs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 = {
Expand Down

0 comments on commit 6d5d633

Please sign in to comment.