update tests for adjusted query string & payload

This commit is contained in:
Brice Ruth 2025-06-16 18:18:52 -05:00
parent 30f4950c5c
commit 04811dd15d
No known key found for this signature in database
GPG Key ID: 5DFD569B02D44E21
2 changed files with 8 additions and 10 deletions

View File

@ -19,14 +19,14 @@ class TestOAuthGoogleGroups:
mock_response_data = {
"memberships": [
{
"group": {
"groupKey": {"id": "admin@company.com"}
}
"groupKey": {"id": "admin@company.com"},
"group": "groups/123",
"displayName": "Admin Group"
},
{
"group": {
"groupKey": {"id": "users@company.com"}
}
"groupKey": {"id": "users@company.com"},
"group": "groups/456",
"displayName": "Users Group"
}
]
}
@ -63,9 +63,9 @@ class TestOAuthGoogleGroups:
mock_session.get.assert_called_once()
call_args = mock_session.get.call_args
# Check the URL contains the user email
# Check the URL contains the user email (URL encoded)
url_arg = call_args[0][0] # First positional argument
assert "user@company.com" in url_arg
assert "user%40company.com" in url_arg # @ is encoded as %40
assert "searchTransitiveGroups" in url_arg
# Check headers contain the bearer token

View File

@ -577,8 +577,6 @@ class OAuthManager:
log.debug(f"Updated profile picture for user {user.email}")
if not user:
user_count = Users.get_num_users()
# If the user does not exist, check if signups are enabled
if auth_manager_config.ENABLE_OAUTH_SIGNUP:
# Check if an existing user with the same email already exists