def test_get_school_invalid_id(self): bad_id = 'notanumber' response = self.get_school(school_id=bad_id) assert response.status_code == HTTPStatus.BAD_REQUEST check_error_response(response, 'school id must be a number')
def test_get_school_not_found(self): bad_id = 1000000000 response = self.get_school(school_id=bad_id) assert response.status_code == HTTPStatus.NOT_FOUND check_error_response(response, f'School with id {bad_id} not found')
def test_update_school_invalid_id(self): bad_id = 'notanumber' response = self.update_school(school_id=bad_id, name="invalid id name") assert response.status_code == HTTPStatus.BAD_REQUEST check_error_response(response, 'school id must be a number')
def test_add_school_bad_name_type(self): new_name = 42 response = self.add_school(name=new_name) assert response.status_code == HTTPStatus.BAD_REQUEST check_error_response(response, 'Field "name" must be a string')
def test_update_school_not_found(self): bad_id = 1000000000 response = self.update_school(school_id=bad_id, name="bad id name") assert response.status_code == HTTPStatus.NOT_FOUND check_error_response(response, f'School with id {bad_id} not found')