-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pro_connect): update family_name key in user_info_mapping_dict
- Loading branch information
1 parent
e76ef97
commit ef138d7
Showing
3 changed files
with
9 additions
and
9 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 |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
|
||
OIDC_USERINFO = { | ||
"given_name": "Michel", | ||
"family_name": "AUDIARD", | ||
"usual_name": "AUDIARD", | ||
"email": "[email protected]", | ||
"sub": "af6b26f9-85cd-484e-beb9-bea5be13e30f", | ||
} | ||
|
@@ -66,7 +66,7 @@ def test_create_user_from_user_info(self): | |
user, created = proc_user_data.create_or_update_user() | ||
self.assertTrue(created) | ||
self.assertEqual(user.email, OIDC_USERINFO["email"]) | ||
self.assertEqual(user.last_name, OIDC_USERINFO["family_name"]) | ||
self.assertEqual(user.last_name, OIDC_USERINFO["usual_name"]) | ||
self.assertEqual(user.first_name, OIDC_USERINFO["given_name"]) | ||
self.assertEqual(user.username, OIDC_USERINFO["sub"]) | ||
|
||
|
@@ -92,7 +92,7 @@ def test_update_user_from_user_info(self): | |
|
||
user = User.objects.get(username=USERINFO["username"]) | ||
self.assertEqual(user.first_name, OIDC_USERINFO["given_name"]) | ||
self.assertEqual(user.last_name, OIDC_USERINFO["family_name"]) | ||
self.assertEqual(user.last_name, OIDC_USERINFO["usual_name"]) | ||
self.assertEqual(user.email, OIDC_USERINFO["email"]) | ||
self.assertNotEqual(user.email, USERINFO["email"]) | ||
|
||
|
@@ -113,6 +113,6 @@ def test_get_existing_user_with_existing_email(self): | |
) | ||
user, created = proc_user_data.create_or_update_user() | ||
self.assertFalse(created) | ||
self.assertEqual(user.last_name, OIDC_USERINFO["family_name"]) | ||
self.assertEqual(user.last_name, OIDC_USERINFO["usual_name"]) | ||
self.assertEqual(user.first_name, OIDC_USERINFO["given_name"]) | ||
self.assertEqual(user.username, OIDC_USERINFO["sub"]) |
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 |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
|
||
OIDC_USERINFO = { | ||
"given_name": "Michel", | ||
"family_name": "AUDIARD", | ||
"usual_name": "AUDIARD", | ||
"email": "[email protected]", | ||
"sub": "af6b26f9-85cd-484e-beb9-bea5be13e30f", | ||
} | ||
|
@@ -113,23 +113,23 @@ def test_callback_user_created(self): | |
self.assertEqual(User.objects.count(), 1) | ||
user = User.objects.get(email=OIDC_USERINFO["email"]) | ||
self.assertEqual(user.first_name, OIDC_USERINFO["given_name"]) | ||
self.assertEqual(user.last_name, OIDC_USERINFO["family_name"]) | ||
self.assertEqual(user.last_name, OIDC_USERINFO["usual_name"]) | ||
self.assertEqual(user.username, OIDC_USERINFO["sub"]) | ||
|
||
@respx.mock | ||
def test_callback_existing_user(self): | ||
# User already exists. | ||
UserFactory( | ||
first_name=OIDC_USERINFO["given_name"], | ||
last_name=OIDC_USERINFO["family_name"], | ||
last_name=OIDC_USERINFO["usual_name"], | ||
username=OIDC_USERINFO["sub"], | ||
email=OIDC_USERINFO["email"], | ||
) | ||
mock_oauth_dance(self) | ||
self.assertEqual(User.objects.count(), 1) | ||
user = User.objects.get(email=OIDC_USERINFO["email"]) | ||
self.assertEqual(user.first_name, OIDC_USERINFO["given_name"]) | ||
self.assertEqual(user.last_name, OIDC_USERINFO["family_name"]) | ||
self.assertEqual(user.last_name, OIDC_USERINFO["usual_name"]) | ||
self.assertEqual(user.username, OIDC_USERINFO["sub"]) | ||
|
||
|
||
|