Пример #1
0
    def test_user_validate_input__fail(self):
        wrong_user_data = USER_TEST_DICT.copy()
        del wrong_user_data['password']             # missing field validation
        wrong_user_data['last_name'] = ''           # empty field validation
        wrong_user_data['email'] = 'email.is.not'   # email validation

        post_data = format_jsonapi_request('user', wrong_user_data)

        errors = UserSchema.validate_input(post_data)

        expected_result = EXPECTED_USERS['user_validate_input__fail']
        assert_valid_response(errors, expected_result)
Пример #2
0
    def test_user_validate_input__success(self):
        post_data = format_jsonapi_request('user', USER_TEST_DICT)

        errors = UserSchema.validate_input(post_data)
        assert errors == {}