Skip to content

Commit

Permalink
Fix api test: pass full set of new associations
Browse files Browse the repository at this point in the history
In the previous version,  we only passed NEW associations, which were
ADDED to the current associations. The new version implements a true
UPDATE operation, which replaces the existing set of associations
with the provided set of associations.
  • Loading branch information
jdavcs committed Aug 31, 2024
1 parent 05a7964 commit dfb7739
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/galaxy_test/api/test_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ def test_update(self):
another_user_id = self.dataset_populator.user_id()
another_role_id = self.dataset_populator.user_private_role_id()
assert another_user_id is not None
update_response = self._put(f"groups/{group_id}", data={"user_ids": [another_user_id]}, admin=True, json=True)
update_response = self._put(
f"groups/{group_id}", data={"user_ids": [user_id, another_user_id]}, admin=True, json=True
)
self._assert_status_code_is_ok(update_response)

# Check if the user was added
Expand All @@ -119,7 +121,9 @@ def test_update(self):
)

# Add another role to the group
update_response = self._put(f"groups/{group_id}", data={"role_ids": [another_role_id]}, admin=True, json=True)
update_response = self._put(
f"groups/{group_id}", data={"role_ids": [user_private_role_id, another_role_id]}, admin=True, json=True
)
self._assert_status_code_is_ok(update_response)

# Check if the role was added
Expand Down

0 comments on commit dfb7739

Please sign in to comment.