Esempio n. 1
0
def test_setemail01():
    new_user = create_user()
    setemail(new_user['token'],"*****@*****.**")
    new_user_dictionary = {
        "u_id": new_user['u_id'],
        "email": '*****@*****.**',
        "name_first": "John",
        "name_last": "Smith",
        "handle_str": "JohnSmith"
    }
    assert profile(new_user['token'],['u_id']) == new_user_dictionary
Esempio n. 2
0
def test_setemail06():
    new_user = create_user()
    with pytest.raises(AccessError):
        setemail('NOT_VALID_TOKEN','*****@*****.**')
Esempio n. 3
0
def test_setemail05():
    test_user = auth.register("*****@*****.**", "Test", "John", "Smith")
    new_user = create_user()
    #New_user will be trying to change their email to test_
    with pytest.raises(InputError):
        setemail(new_user['token'],'*****@*****.**')
Esempio n. 4
0
def test_setemail04():
    new_user = create_user()
    with pytest.raises(InputError):
        setemail(new_user['token'],'gmailgmail.com')
Esempio n. 5
0
def test_setemail02():
    new_user = create_user()
    #New Email with no personal info
    with pytest.raises(InputError):
        setemail(new_user['token'],'@gmail.com')
Esempio n. 6
0
def user_setemail():
    data = request.get_json()
    return dumps(user.setemail(data["token"], data["email"]))