From dfb7739ac2d7beebc0c9170f16f087eeceb7c8ee Mon Sep 17 00:00:00 2001 From: John Davis Date: Fri, 30 Aug 2024 18:26:00 -0400 Subject: [PATCH] Fix api test: pass full set of new associations 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. --- lib/galaxy_test/api/test_groups.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/galaxy_test/api/test_groups.py b/lib/galaxy_test/api/test_groups.py index 8e4c5510fe98..0176bde0d21c 100644 --- a/lib/galaxy_test/api/test_groups.py +++ b/lib/galaxy_test/api/test_groups.py @@ -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 @@ -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