-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow filtering of members list by email (#26450)
- Loading branch information
1 parent
4ed8279
commit 63a2418
Showing
2 changed files
with
23 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -240,3 +240,17 @@ def test_add_owner_only_if_owner(self): | |
self.assertEqual(response.status_code, 403) | ||
self.assertEqual(self.organization_membership.level, OrganizationMembership.Level.ADMIN) | ||
self.assertEqual(membership.level, OrganizationMembership.Level.MEMBER) | ||
|
||
def test_list_organization_members_filter_by_email(self): | ||
# Create additional users | ||
user1 = User.objects.create_and_join(self.organization, "[email protected]", None) | ||
User.objects.create_and_join(self.organization, "[email protected]", None) | ||
|
||
# Test filtering by email | ||
response = self.client.get("/api/organizations/@current/members/[email protected]") | ||
response_data = response.json()["results"] | ||
|
||
self.assertEqual(response.status_code, status.HTTP_200_OK) | ||
self.assertEqual(len(response_data), 1) | ||
self.assertEqual(response_data[0]["user"]["email"], "[email protected]") | ||
self.assertEqual(response_data[0]["user"]["uuid"], str(user1.uuid)) |