def test_update_non_existing_2(json_client, data, db_cur, redis_connection): data["events"][0] = { "type": "update", "fqid": "a/1", "fields": { "f": None } } response = json_client.post(WRITE_URL, data) assert_error_response(response, ERROR_CODES.MODEL_DOES_NOT_EXIST) assert_no_db_entry(db_cur) assert_no_modified_fields(redis_connection)
def check_no_db_entry(db_cur): yield assert_no_db_entry(db_cur)
def test_create_twice(json_client, data, db_cur, redis_connection): data["events"].append(data["events"][0]) response = json_client.post(WRITE_URL, data) assert_error_response(response, ERROR_CODES.MODEL_EXISTS) assert_no_db_entry(db_cur) assert_no_modified_fields(redis_connection)