示例#1
0
 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')
示例#2
0
 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')
示例#3
0
 def test_add_car(self):
     '''
     测试添加购物车
     :return:
     '''
     res = add_car(1, 1, 8)
     self.assertEqual(res, 0)
示例#4
0
 def test_add_car(self):
     '''
     测试添加购物车
     :return:
     '''
     res = add_car(1,1,8)
     self.assertEqual(res,0)