Exemple #1
0
def test_user_profile_sethandle_2():
    reset_users()
    user_dict1 = auth_register("*****@*****.**", "password", "firstname",
                               "lastname")
    u_token = user_dict1['token']
    with pytest.raises(ValueError):
        user_profile_sethandle(u_token, 21 * 'A')
Exemple #2
0
def test_user_profile_sethandle_5():
    reset_users()
    user_dict1 = auth_register("*****@*****.**", "password", "firstname",
                               "lastname")
    u_token = user_dict1['token']
    with pytest.raises(ValueError):
        user_profile_sethandle(u_token, '!@#$%^&*()+_-=|/\{}[];:?><~""')
Exemple #3
0
def test_user_profile_sethandle_6():
    reset_users()
    user_dict1 = auth_register("*****@*****.**", "password", "firstname",
                               "lastname")
    u_token = user_dict1['token']
    u_id = user_dict1['u_id']
    user_profile_sethandle(u_token, '!@#$%^&*()+_-=|/\{}?')
    assert (user_profile(u_token, u_id) == {
        'email': '*****@*****.**',
        'name_first': 'firstname',
        'name_last': 'lastname',
        'handle_str': '!@#$%^&*()+_-=|/\{}?'
    })
Exemple #4
0
def test_user_profile_2():
    reset_users()
    user_dict2 = auth_register('*****@*****.**', 'hello123', 'Steven2',
                               'Lay')
    user2 = user_dict2['token']
    user2_id = user_dict2['u_id']
    user_profile_sethandle(user2, 'l33thack3r')
    profile_dict2 = user_profile(user2, user2_id)
    assert (profile_dict2 == {
        'email': '*****@*****.**',
        'name_first': 'Steven2',
        'name_last': 'Lay',
        'handle_str': 'l33thack3r'
    })