def test_rental_update_without_permission(self): rental = RentalModel(rental_schema.load(self.rental1)) rental.save() res = RentalService.update(1, rental_schema.load({}, partial=True)) self.assertEqual(res.status_code, 400)
def put(self, rental_id: int): """Update Rental""" req_data = request.get_json() return RentalService.update(rental_id, req_data)
def test_rental_update_not_found(self): rental = RentalModel(rental_schema.load(self.rental1)) rental.save() res = RentalService.update(33, rental_schema.load({}, partial=True)) self.assertEqual(res.status_code, 404)