-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CognitoIDP: Fix Limit and Filter params for list_users() (#8392)
- Loading branch information
1 parent
ad7de35
commit 8896093
Showing
3 changed files
with
70 additions
and
49 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
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 |
---|---|---|
|
@@ -2519,6 +2519,28 @@ def test_list_users(): | |
result = conn.list_users(UserPoolId=user_pool_id, Filter='family_name=""') | ||
assert len(result["Users"]) == 0 | ||
|
||
# checking Limit and Filter work correctly together | ||
user1_username = "[email protected]" | ||
conn.admin_create_user( | ||
UserPoolId=user_pool_id, | ||
Username=user1_username, | ||
UserAttributes=[{"Name": "phone_number", "Value": "+48555555555"}], | ||
) | ||
|
||
result = conn.list_users( | ||
UserPoolId=user_pool_id, Filter='phone_number ^= "+48"', Limit=1 | ||
) | ||
assert len(result["Users"]) == 1 | ||
assert result["PaginationToken"] is not None | ||
|
||
result = conn.list_users( | ||
UserPoolId=user_pool_id, | ||
Filter='phone_number ^= "+48"', | ||
Limit=1, | ||
PaginationToken=result["PaginationToken"], | ||
) | ||
assert len(result["Users"]) == 1 | ||
|
||
|
||
@mock_aws | ||
def test_list_users_incorrect_filter(): | ||
|