def test_update2(self): user2 = { "id_user": 4, "id_book": 7, "date": "2020-04-05", "price": 45000 } self.assertTrue(Borrowbook.updateInfo(**user2))
def test_update(self): user1 = { "id_user": 3, "id_book": 3, "date": "2019-11-17", "price": 23000 } self.assertTrue(Borrowbook.updateInfo(**user1))
def put(self): query = request.get_json() try: id_ = Borrowbook.updateInfo(**query) if id_: res = Borrowbook.get_detail(id_) return make_response(jsonify({"data": res}), 200) return make_response(jsonify({"message": "ok"}), 201) except Exception as e: return make_response(jsonify({"message": str(e)}), 400)
def test_update(self): self.assertTrue(Borrowbook.updateInfo(**user14)) self.assertTrue(Borrowbook.updateInfo(**user15))
def test_update(self): with library_mysql.atomic() as txn: Borrowbook.updateInfo(**user14) Borrowbook.updateInfo(**user15) txn.rollback()