Commit 4ceff2aab1e22530b6a01025ff998b6fb944101a

Authored by lixi
1 parent 60891f49

优化测试用例的代码

commons/api/weighingServiceSave.py
... ... @@ -46,7 +46,6 @@ class weighingServiceSave():
46 46 self.market=market
47 47 self.url = weighingServiceSave.url.replace("http://test.", com.get_global_config("global_data", "environment", "en"))
48 48 self.header = weighingServiceSave.header
49   - self.header["jmsf_duplicate_commit_token"] = duplicateToken(self.market).jmsf_duplicate_commit_token()
50 49 self.header["UAP_accessToken"] = self.market.cookies["UAP_accessToken"]
51 50 self.header["UAP_refreshToken"] = self.market.cookies["UAP_refreshToken"]
52 51 self.header["UAP_firmId"] = self.market.cookies["UAP_firmId"]
... ...
testcase/CZFW/test_weightBizBill_doRefund.py
... ... @@ -20,6 +20,9 @@ class test_weightBizBill_doRefund(unittest.TestCase):
20 20  
21 21 def setUp(self):
22 22 "数据准备:新增一条称重单"
  23 + #刷新增防重码
  24 + ad.refresh_commit_token()
  25 + #新增称重单
23 26 body=ad.body.copy()
24 27 car=ca.car_list()["data"]
25 28 body["carTypeId"]=car[0]["id"]
... ...
testcase/CZFW/test_weightBizBill_listPage.py
... ... @@ -21,15 +21,16 @@ class test_weightBizBill_listPage(unittest.TestCase):
21 21 "数据准备:新增一条称重单"
22 22 #获取当前时间
23 23 self.time=time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
24   - #新增数据
  24 + #刷新增防重码
25 25 ad.refresh_commit_token()
  26 + #新增数据
26 27 body=ad.body.copy()
27 28 car=ca.car_list()["data"]
28 29 body["carTypeId"]=car[0]["id"]
29 30 body["carTypeName"]=car[0]["carTypeName"]
30 31 body["carTypeCode"]=car[0]["code"]
31 32 self.re=sy1.post(url=ad.url,headers=ad.header,json=body)
32   - #刷新防重码
  33 +
33 34  
34 35 @unittest.case_mark(my.mark())
35 36 def test_weightBizBill_listPage_01(self):
... ...
testcase/weightBizBill/test_weighingServiceSave.py
... ... @@ -22,7 +22,6 @@ class test_weighingServiceSave(unittest.TestCase):
22 22 def setUp(self) :
23 23 we.refresh_commit_token()
24 24  
25   -
26 25 @unittest.case_mark(my.mark())
27 26 def test_weighingServiceSave_01(self):
28 27 "称重服务:成功新增一条称重服务单"
... ...