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