Ejemplo n.º 1
0
def test_user_transform_with_all_values():
    user = create_test_user()

    result = transform_okta_user(user)

    expected = {
        'id': user.id,
        'activated': '01/01/2019, 00:00:01',
        'created': '01/01/2019, 00:00:01',
        'status_changed': '01/01/2019, 00:00:01',
        'last_login': '******',
        'okta_last_updated': '01/01/2019, 00:00:01',
        'password_changed': '01/01/2019, 00:00:01',
        'transition_to_status': user.transitioningToStatus,
        'login': user.profile.login,
        'email': user.profile.email,
        'last_name': user.profile.lastName,
        'first_name': user.profile.firstName,
    }

    assert result == expected
Ejemplo n.º 2
0
def test_userprofile_transform_with_no_last_login():
    user = create_test_user()
    user.lastLogin = None

    result = transform_okta_user(user)

    expected = {
        'id': user.id,
        'activated': '01/01/2019, 00:00:01',
        'created': '01/01/2019, 00:00:01',
        'status_changed': '01/01/2019, 00:00:01',
        'last_login': None,
        'okta_last_updated': '01/01/2019, 00:00:01',
        'password_changed': '01/01/2019, 00:00:01',
        'transition_to_status': user.transitioningToStatus,
        'login': user.profile.login,
        'email': user.profile.email,
        'second_email': user.profile.secondEmail,
        'last_name': user.profile.lastName,
        'first_name': user.profile.firstName,
        'mobile_phone': user.profile.mobilePhone,
    }

    assert result == expected