test_feedback_order_settlement.py
1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import unittest
import urllib3
from commons.MySession import my,sy1
from commons.api.feedback_order_settlement import feedback_order_settlement
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
from commons.api.feedback_order_settlement_query import feedback_order_settlement_query
fosq = feedback_order_settlement_query()
fos = feedback_order_settlement()
class test_feedback_order_settlement(unittest.TestCase):
"结账管理——结账"
@classmethod
def setUpClass(cls):
pass
def setUp(self):
body = fosq.body.replace("feedbackCustomerId=25", "feedbackCustomerId=16").replace("2021-07-22 00:00:00", "\
2021-07-03 00:00:00").replace("2021-08-03 23:59:59","2021-08-03 23:59:59")
re = sy1.post(url=fosq.url, data=body, headers=fosq.header, proxies=my.myproxies)
Amount = re.json()["rows"][0]["unsettledAmount"]
ids = re.json()["rows"][0]["id"]
billIds = re.json()["rows"][0]["billId"]
return Amount, ids, billIds
def test_feedback_order_settlement_01(self):
body = fos.body.replace("id=25","id=25").replace("888810057654","888810057654").replace("settleAmount=2","settleAmount=2").\
replace("ids=12034","ids=11953").\
replace("feedbackCustomerId=25","feedbackCustomerId=25").\
replace("feedbackCustomerName=验证员工推送到CRM","feedbackCustomerName=验证员工推送到CRM").\
replace("billIds=3621","billIds=3493").\
replace("settledAmounts=2","settledAmounts=2")
re = sy1.post(url = fos.url, headers = fos.header, data = body.encode('utf-8'))
# print(re.headers)
# print(re.json())
self.assertTrue("操作成功" in str(re.json()))
return re
@classmethod
def tearDownClass(cls):
pass
if __name__ == '__main__':
unittest.main()