Commit 54b85a38653370769f2a6fdc981b7352371822cd
1 parent
82a3ff23
结算优化
Showing
1 changed file
with
17 additions
and
12 deletions
testcase/FeedbackOrderController/test_feedback_order_settlement.py
... | ... | @@ -4,6 +4,7 @@ from commons.MySession import my,sy1 |
4 | 4 | from commons.api.feedback_order_settlement import feedback_order_settlement |
5 | 5 | urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) |
6 | 6 | from commons.api.feedback_order_settlement_query import feedback_order_settlement_query |
7 | +import random | |
7 | 8 | fosq = feedback_order_settlement_query() |
8 | 9 | |
9 | 10 | fos = feedback_order_settlement() |
... | ... | @@ -17,24 +18,28 @@ class test_feedback_order_settlement(unittest.TestCase): |
17 | 18 | def setUp(self): |
18 | 19 | body = fosq.body.replace("feedbackCustomerId=25", "feedbackCustomerId=16").replace("2021-07-22 00:00:00", "\ |
19 | 20 | 2021-07-03 00:00:00").replace("2021-08-03 23:59:59","2021-08-03 23:59:59") |
20 | - re = sy1.post(url=fosq.url, data=body, headers=fosq.header, proxies=my.myproxies) | |
21 | - Amount = re.json()["rows"][0]["unsettledAmount"] | |
22 | - ids = re.json()["rows"][0]["id"] | |
23 | - billIds = re.json()["rows"][0]["billId"] | |
24 | - return Amount, ids, billIds | |
21 | + re = sy1.post(url=fosq.url, data=body, headers=fosq.header) | |
22 | + # self.id = re.json()["rows"][0]["id"] | |
23 | + self.Amount = re.json()["rows"][0]["unsettledAmount"] | |
24 | + self.ids = re.json()["rows"][0]["id"] | |
25 | + self.billIds = re.json()["rows"][0]["billId"] | |
26 | + # | |
27 | + # elf.name = re.json()["rows"][0]["name"] | |
28 | + | |
25 | 29 | |
26 | 30 | def test_feedback_order_settlement_01(self): |
27 | - body = fos.body.replace("id=25","id=25").replace("888810057654","888810057654").replace("settleAmount=2","settleAmount=2").\ | |
28 | - replace("ids=12034","ids=11953").\ | |
31 | + body = fos.body.replace("id=25","id=25").replace("888810057654","888810057654")\ | |
32 | + .replace("settleAmount=2","settleAmount="+str(self.Amount)).\ | |
33 | + replace("ids=12034","ids="+str(self.ids)).\ | |
29 | 34 | replace("feedbackCustomerId=25","feedbackCustomerId=25").\ |
30 | 35 | replace("feedbackCustomerName=验证员工推送到CRM","feedbackCustomerName=验证员工推送到CRM").\ |
31 | - replace("billIds=3621","billIds=3493").\ | |
32 | - replace("settledAmounts=2","settledAmounts=2") | |
33 | - | |
36 | + replace("billIds=3621","billIds="+str(self.billIds)).\ | |
37 | + replace("settledAmounts=2","settledAmounts="+str(self.Amount)) | |
38 | + print(body) | |
34 | 39 | re = sy1.post(url = fos.url, headers = fos.header, data = body.encode('utf-8')) |
35 | - # print(re.headers) | |
40 | + print(re.headers) | |
36 | 41 | |
37 | - # print(re.json()) | |
42 | + print(re.json()) | |
38 | 43 | self.assertTrue("操作成功" in str(re.json())) |
39 | 44 | return re |
40 | 45 | ... | ... |