Commit 310157031499f5d4264bb6ba251ee8fd97699353
1 parent
5a895d74
修改查询语句
Showing
1 changed file
with
57 additions
and
15 deletions
testcase/hg/tradingOrder/test_createAndTrade.py
1 | 1 | import unittest |
2 | 2 | import urllib3 |
3 | -from commons.MySession import hg,my | |
4 | -from commons.api.hg.transaction import createAndTrade | |
5 | 3 | urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) |
6 | -import commons.ConfigDB as db | |
7 | -crat = createAndTrade() | |
4 | +from commons.MySession import hg,my | |
5 | +from commons import ConfigDB as db | |
6 | +from commons.api.hg.transaction.createAndTrade import createAndTrade | |
7 | +from commons.basic.registerRecord_save import registerRecord_save | |
8 | +creat = createAndTrade() | |
9 | +r = registerRecord_save() | |
8 | 10 | |
9 | 11 | """ |
10 | 12 | 创建大客户订单 |
... | ... | @@ -14,19 +16,59 @@ class test_createAndTrade(unittest.TestCase): |
14 | 16 | "创建大客户订单" |
15 | 17 | @classmethod |
16 | 18 | def setUpClass(cls): |
17 | - pass | |
18 | - def setUp(self): | |
19 | - pass | |
19 | + # 新增一个进门批号单 | |
20 | + # 新增一个进门批号单 | |
21 | + # cls.aaa = db.mysql_selectOne(''' | |
22 | + # SELECT | |
23 | + # aua.account_id,auc.card_no,aua.customer_id,aua.customer_code,aua.customer_name,aua.customer_certificate_number | |
24 | + # FROM | |
25 | + # ( `dili_account`.`account_user_account` AS aua LEFT JOIN `dili_account`.`account_user_card` AS auc ON aua.account_id = auc.account_id ) | |
26 | + # LEFT JOIN `dili-customer`.`special_permissions` AS sp ON aua.customer_id = sp.customer_id | |
27 | + # ORDER BY aua.account_id DESC LIMIT 1 | |
28 | + # ''') | |
29 | + cls.aaa = db.mysql_selectOne(''' | |
30 | + SELECT | |
31 | + aua.account_id AS "账号id", | |
32 | + auc.card_no AS "园区卡号", | |
33 | + aua.customer_id AS "客户id", | |
34 | + aua.customer_code AS "客户code", | |
35 | + aua.customer_name AS "客户姓名", | |
36 | + aua.customer_certificate_number AS "客户身份证号码", | |
37 | + aua.hold_contacts_phone AS "持卡人电话" | |
38 | +FROM | |
39 | + ( `dili_account`.`account_user_account` AS aua LEFT JOIN `dili_account`.`account_user_card` AS auc ON aua.account_id = auc.account_id ) | |
40 | + LEFT JOIN `dili-customer`.`special_permissions` AS sp ON aua.customer_id = sp.customer_id | |
41 | +WHERE | |
42 | + sp.customer_id = 141962 AND sp.market_id =15 | |
43 | +ORDER BY | |
44 | + aua.account_id DESC | |
45 | + LIMIT 1 | |
46 | + ''') | |
47 | + body2 = r.body.copy() | |
48 | + body2["accountId"] = str(cls.aaa[0]) | |
49 | + body2["cardNo"] = str(cls.aaa[1]) | |
50 | + body2["customerId"] = str(cls.aaa[2]) | |
51 | + body2["customerCode"] = str(cls.aaa[3]) | |
52 | + body2["customerName"] = str(cls.aaa[4]) | |
53 | + body2["identityCardNo"] = str(cls.aaa[5]) | |
54 | + body2["mobilephoneNumber"] = str(cls.aaa[6]) | |
55 | + print("士大夫但是",body2) | |
56 | + print("水电费",cls.aaa) | |
57 | + print("撒地方",type(cls.aaa)) | |
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 | |
20 | 62 | |
63 | + @unittest.case_mark(my.mark()) | |
21 | 64 | def test_createAndTrade_01(self): |
22 | - "创建大客户借款单" | |
23 | - | |
24 | - @unittest.case_mark(my.mark()) | |
25 | - def test_vipCustomerLoan_details_01(self): | |
26 | - "大客户借款-详情:选择指定大客户借款数据,点击查看" | |
27 | - re = hg.post(url=crat.url, headers=crat.header, json=crat.body) | |
28 | - print(re.json()) | |
29 | - self.assertTrue("'操作成功'" in str(re.json()).replace(" ", "")) | |
65 | + "大客户创建订单" | |
66 | + body = creat.body.copy() | |
67 | + body["orderItemList"][0]["batchCode"] = self.batch | |
68 | + re1 = hg.post(url = creat.url, headers = creat.header, json = body,proxies = hg.proxies) | |
69 | + print(re1.json()) | |
70 | + self.assertEqual(re1.status_code, 200) | |
71 | + self.assertTrue("'操作成功'" in str(re1.json()).replace(" ", "")) | |
30 | 72 | |
31 | 73 | |
32 | 74 | @classmethod | ... | ... |