def post(self, *args, **kwargs): user_id = self.get_secure_cookie("user_id") user_id = int(user_id) product_id = self.get_argument("product_id") product_id = int(product_id) buyCount = self.get_argument("buyCount") buyCount = int(buyCount) add_car(product_id,user_id,buyCount) self.redirect('/car')
def post(self, *args, **kwargs): user_id = self.get_secure_cookie("user_id") user_id = int(user_id) product_id = self.get_argument("product_id") product_id = int(product_id) buyCount = self.get_argument("buyCount") buyCount = int(buyCount) add_car(product_id, user_id, buyCount) self.redirect('/car')
def test_add_car(self): ''' 测试添加购物车 :return: ''' res = add_car(1, 1, 8) self.assertEqual(res, 0)
def test_add_car(self): ''' 测试添加购物车 :return: ''' res = add_car(1,1,8) self.assertEqual(res,0)