def setEmail(): data = getData() email, token = (request.form[x] for x in ('email', 'token')) checkTokenValidity(token, data) user_profile_setemail(data, token, email) return sendSuccess({})
def test_user_profile_setemail_correct(): user_profile_setemail(data, token, "*****@*****.**") user_profile_setemail(data, token, "*****@*****.**")
def test_user_profile_setemail_invaild_token(): with pytest.raises(errors.ValueError): user_profile_setemail(data, 'invalidToken' , "*****@*****.**")
def test_user_profile_setemail_long(): with pytest.raises(errors.ValueError): user_profile_setemail(data, token, "*****@*****.**")
def test_user_profile_setemail_invalid_09(): with pytest.raises(errors.ValueError): user_profile_setemail(data, token, "she\/?rry@gmailcom")
def test_user_profile_setemail_invalid_05(): with pytest.raises(errors.ValueError): user_profile_setemail(data, token, "123")