def test_sex_update(): sex_vars = ['0', '1', '2'] sex = random.choice(sex_vars) response = post_member_update(email=email, password=password, sex=sex) assert response.status_code == 200 schema = open("schemes/get_profile.json").read() validate_jsonschema(schema, response) j = json.loads(response.text) assert j['sex'] == sex
def test_email_update(): new_email = 'update' + str(time.time()) + '@test.com' response = post_member_update(email=email, password=password, newemail=new_email) assert response.status_code == 200 schema = open("schemes/get_profile.json").read() validate_jsonschema(schema, response) j = json.loads(response.text) assert j['email'] == new_email
def test_name_update(): firstname = id_generator(size=10) lastname = id_generator(size=10) response = post_member_update(email=email, password=password, firstname=firstname, lastname=lastname) assert response.status_code == 200 schema = open("schemes/get_profile.json").read() validate_jsonschema(schema, response) j = json.loads(response.text) assert j['firstName'] == firstname assert j['lastName'] == lastname
def test_jsonschema_charities(): schema = open("schemes/get_charities.json").read() response = get_charities() validate_jsonschema(schema, response)
def test_jsonschema_news_by_uuid(): schema = open("schemes/get_news_by_uuid.json").read() response = get_news_by_uuid() validate_jsonschema(schema, response)
def test_jsonschema_photo(): schema = open("schemes/get_profile.json").read() response = post_photo(email=email, password=password, image=image) validate_jsonschema(schema, response)
def test_jsonschema_profile(): schema = open("schemes/get_profile.json").read() response = get_profile(email=email, password=password) validate_jsonschema(schema, response)
def test_jsonschema_auth(): schema = open("schemes/post_auth.json").read() response = post_auth(email=email, password=password) validate_jsonschema(schema, response)
def test_post_registration(): response = post_registration(email=new_email, password=password) assert response.status_code == 200 schema = open("schemes/post_auth.json").read() validate_jsonschema(schema, response)