@@ -90,7 +90,7 @@ def test_token_user_context(session, auth_mock, monkeypatch):
9090@mock .patch ("auth_api.services.affiliation_invitation.RestService.get_service_account_token" , mock_token )
9191def test_change_authentication_subsequent_invites (session , auth_mock , keycloak_mock , monkeypatch ):
9292 """Assert that changing org authentication method changes new invitation required login source."""
93- user_with_token = TestUserInfo .user_tester
93+ user_with_token = dict ( TestUserInfo .user_tester )
9494 user_with_token ["keycloak_guid" ] = TestJwtClaims .tester_role ["sub" ]
9595 user_with_token ["idp_userid" ] = TestJwtClaims .tester_role ["idp_userid" ]
9696 inviter_user = factory_user_model (user_info = user_with_token )
@@ -176,7 +176,7 @@ def test_change_authentication_non_govm(session, auth_mock, keycloak_mock, monke
176176 invitee_bcsc_user = factory_user_model (TestUserInfo .user1 )
177177 invitee_bceid_user = factory_user_model (TestUserInfo .user2 )
178178
179- patch_token_info (TestJwtClaims .tester_role , monkeypatch )
179+ patch_token_info (TestJwtClaims .user_test , monkeypatch )
180180 org = OrgService .create_org (TestOrgInfo .org1 , user_id = inviter_user .id )
181181 org_dictionary = org .as_dict ()
182182
@@ -219,14 +219,14 @@ def test_change_authentication_non_govm(session, auth_mock, keycloak_mock, monke
219219 assert invitation_model .login_source == LoginSource .BCSC .value
220220 assert invitation_model .invitation_status_code == InvitationStatus .ACCEPTED .value
221221
222- patch_token_info (TestJwtClaims .tester_role , monkeypatch )
222+ patch_token_info (TestJwtClaims .user_test , monkeypatch )
223223 members = MembershipService .get_members_for_org (org_dictionary ["id" ], "PENDING_APPROVAL" )
224224 assert members
225225 assert len (members ) == 1
226226
227227 # Confirm that an invitation with BCSC login source can be accepted as another user login source and
228228 # updates the invitation login source based on the accepting user login source
229- patch_token_info (TestJwtClaims .tester_role , monkeypatch )
229+ patch_token_info (TestJwtClaims .user_test , monkeypatch )
230230 with patch .object (InvitationService , "send_invitation" , return_value = None ):
231231 # Create invitation with BCSC login source
232232 with patch .object (ActivityLogPublisher , "publish_activity" , return_value = None ) as mock_alp :
@@ -265,7 +265,7 @@ def test_change_authentication_non_govm(session, auth_mock, keycloak_mock, monke
265265 assert invitation_model .login_source == LoginSource .BCEID .value
266266 assert invitation_model .invitation_status_code == InvitationStatus .ACCEPTED .value
267267
268- patch_token_info (TestJwtClaims .tester_role , monkeypatch )
268+ patch_token_info (TestJwtClaims .user_test , monkeypatch )
269269 members = MembershipService .get_members_for_org (org_dictionary ["id" ], "PENDING_APPROVAL" )
270270 assert members
271271 assert len (members ) == 2
@@ -362,7 +362,7 @@ def test_invitation_anonymous(session, auth_mock, keycloak_mock, monkeypatch):
362362 inviter_user = factory_user_model (TestUserInfo .user_tester )
363363 invitee_bcsc_user = factory_user_model (TestUserInfo .user1 )
364364
365- patch_token_info (TestJwtClaims .tester_role , monkeypatch )
365+ patch_token_info (TestJwtClaims .user_test , monkeypatch )
366366 org = OrgService .create_org (TestOrgInfo .org1 , user_id = inviter_user .id )
367367 org_dictionary = org .as_dict ()
368368
@@ -400,7 +400,7 @@ def test_invitation_anonymous(session, auth_mock, keycloak_mock, monkeypatch):
400400 assert invitation_model .login_source is None
401401 assert invitation_model .invitation_status_code == InvitationStatus .ACCEPTED .value
402402
403- patch_token_info (TestJwtClaims .tester_role , monkeypatch )
403+ patch_token_info (TestJwtClaims .user_test , monkeypatch )
404404 members = MembershipService .get_members_for_org (org_dictionary ["id" ], "PENDING_APPROVAL" )
405405 assert members
406406 assert len (members ) == 1
0 commit comments