Commit 056eff61f68c400700b119a99e3b1f91f891bd0d

Authored by wenleiming
1 parent c78e4bf0

创建大客户订单

testcase/hg/tradingOrder/test_createAndTrade.py
@@ -52,25 +52,25 @@ ORDER BY @@ -52,25 +52,25 @@ ORDER BY
52 body2["customerName"] = str(cls.aaa[4]) 52 body2["customerName"] = str(cls.aaa[4])
53 body2["identityCardNo"] = str(cls.aaa[5]) 53 body2["identityCardNo"] = str(cls.aaa[5])
54 body2["mobilephoneNumber"] = str(cls.aaa[6]) 54 body2["mobilephoneNumber"] = str(cls.aaa[6])
55 - print("士大夫但是",body2)  
56 - print("水电费",cls.aaa)  
57 - print("撒地方",type(cls.aaa)) 55 + body2["categoryId"] = 44
  56 + body2["categoryCode"] = 754107
  57 + body2["categoryName"] = "葡萄"
58 re = hg.post(url = r.url, headers = r.header, json = body2,proxies = hg.proxies) 58 re = hg.post(url = r.url, headers = r.header, json = body2,proxies = hg.proxies)
59 - # 获取批号  
60 - # cls.batch = re.json()["data"]["batchCode"]  
61 - # return cls.batch 59 + "获取批号"
  60 + print("获取批号结果:",re.json())
  61 + cls.batch = re.json()["data"]["batchCode"]
  62 + return cls.batch
62 63
63 @unittest.case_mark(my.mark()) 64 @unittest.case_mark(my.mark())
64 def test_createAndTrade_01(self): 65 def test_createAndTrade_01(self):
65 "大客户创建订单" 66 "大客户创建订单"
66 body = creat.body.copy() 67 body = creat.body.copy()
67 body["orderItemList"][0]["batchCode"] = self.batch 68 body["orderItemList"][0]["batchCode"] = self.batch
  69 + print("创建订单body",body)
68 re1 = hg.post(url = creat.url, headers = creat.header, json = body,proxies = hg.proxies) 70 re1 = hg.post(url = creat.url, headers = creat.header, json = body,proxies = hg.proxies)
69 print(re1.json()) 71 print(re1.json())
70 self.assertEqual(re1.status_code, 200) 72 self.assertEqual(re1.status_code, 200)
71 self.assertTrue("'操作成功'" in str(re1.json()).replace(" ", "")) 73 self.assertTrue("'操作成功'" in str(re1.json()).replace(" ", ""))
72 -  
73 -  
74 @classmethod 74 @classmethod
75 def tearDownClass(cls): 75 def tearDownClass(cls):
76 pass 76 pass