Skip to content

Commit

Permalink
Use sets instead
Browse files Browse the repository at this point in the history
  • Loading branch information
zachaysan committed Jan 22, 2025
1 parent ca7ee8d commit b2419c0
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions api/tests/unit/users/test_unit_users_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,13 +926,7 @@ def test_list_user_groups(
group_2 = response_json["results"][1]
group_2_users = group_2["users"]
assert len(group_2_users) == 2

for user in group_2_users:
if user["id"] == user1.pk:
assert user["group_admin"] is False
continue
if user["id"] == user2.pk:
assert user["group_admin"] is True
continue
# We should only match the two users.
assert False
assert set((user["id"], user["group_admin"]) for user in group_2_users) == {
(user1.pk, False),
(user2.pk, True),
}

0 comments on commit b2419c0

Please sign in to comment.