-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No-Issue Signed-off-by: James Tanner <[email protected]>
- Loading branch information
Showing
5 changed files
with
32 additions
and
5 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
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 |
---|---|---|
|
@@ -152,7 +152,10 @@ def test_me_social_with_v1_synced_user(ansible_config): | |
""" Make sure social auth associates to the correct username """ | ||
|
||
username = 'geerlingguy' | ||
real_email = '[email protected]' | ||
unverified_email = '[email protected]' | ||
cleanup_social_user(username, ansible_config) | ||
cleanup_social_user(unverified_email, ansible_config) | ||
|
||
admin_config = ansible_config("admin") | ||
admin_client = get_client( | ||
|
@@ -166,6 +169,10 @@ def test_me_social_with_v1_synced_user(ansible_config): | |
resp = admin_client('/api/v1/sync/', method='POST', args=pargs) | ||
wait_for_v1_task(resp=resp, api_client=admin_client) | ||
|
||
# should have an unverified user ... | ||
unverified_user = admin_client(f'/api/_ui/v1/users/?username={username}')['data'][0] | ||
assert unverified_user['email'] == unverified_email | ||
|
||
# set the social config ... | ||
cfg = ansible_config(username) | ||
|
||
|
@@ -176,6 +183,16 @@ def test_me_social_with_v1_synced_user(ansible_config): | |
uinfo = resp.json() | ||
assert uinfo['username'] == cfg.get('username') | ||
|
||
# should have the same ID ... | ||
assert uinfo['id'] == unverified_user['id'] | ||
|
||
# should have the right email | ||
assert uinfo['email'] == real_email | ||
|
||
# the unverified email should not be a user ... | ||
bad_users = admin_client(f'/api/_ui/v1/users/?username={unverified_email}') | ||
assert bad_users['meta']['count'] == 0, bad_users | ||
|
||
|
||
@pytest.mark.deployment_community | ||
def test_social_auth_creates_group(ansible_config): | ||
|
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 |
---|---|---|
|
@@ -68,10 +68,10 @@ | |
'email': '[email protected]', | ||
}, | ||
'geerlingguy': { | ||
'id': 1004, | ||
'id': 15481850, | ||
'login': 'geerlingguy', | ||
'password': 'redhat', | ||
'email': 'geerlingguy@gmail.com', | ||
'email': 'geerlingguy@nohaxx.me', | ||
} | ||
} | ||
|
||
|