def get(self, id): s = Borrowbook() try: res = s.search(id) if res: return jsonify(res) return make_response(jsonify({"message": "Ticket not found"}), 404) except Exception as e: return make_response(jsonify({"message": str(e)}), 400)
def test_search(self): self.assertTrue(Borrowbook.search(2)) self.assertTrue(Borrowbook.search(1))
def test_search(self): with library_mysql.atomic() as txn: Borrowbook.search(2) Borrowbook.search(1) txn.rollback()