test_fc_edit.py
2.48 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import unittest
import urllib3
from commons.MySession import my,sy1
from commons.api.fc_edit import fc_edit
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
from commons.Faker import random_data
from commons.api.fc_add import fc_add
ra = random_data()
fca = fc_add()
import commons.ConfigDB as db
"""
进门收费——返点管理——返还人管理——修改返还人
"""
fc=fc_edit()
class test_fc_edit(unittest.TestCase):
"返还人管理——修改返还人"
@classmethod
def setUpClass(cls):
pass
def setUp(self):
# body = fc.body.replace("18828281176", ra.phone_number()). \
# replace("你好", ra.name()). \
# replace("888810054630", "888810054630")
#
# # body = fca.body.replace("888810054630", "888810054630"). \
# # replace("你好", ra.name()). \
# # replace("relationCardTemp=888810054630", "relationCardTemp=888810054630"). \
# # replace("relationalCard[0].cardNumber=888810054630", "relationalCard[0].cardNumber=888810054630")
# # print(body)
# re = sy1.post(url = fc.url, headers = fc.header, data = body.encode('utf-8'), proxies = my.proxies)
self.mesg = db.mysql_selectOne('''SELECT id,name,mobile,card_number
FROM `dili_jmsf`.`feedback_customer` WHERE market_id = '''+str(sy1.user["sy_user01"]["firmId"])+''' ORDER BY `id` DESC LIMIT 1''')
# print(self.mesg)
def test_fc_edit_01(self):
"id=40&name=农交&mobile=18828281176&cardNumber=888810054630&\
relationCardTemp=210720133001&relationalCard[0].cardNumber=210720131533"
body = fc.body.replace("id=40","id="+str(self.mesg[0])).\
replace("农交",str(self.mesg[1])).\
replace("18828281176",str(self.mesg[2])).\
replace("888810054630",str(self.mesg[3]))
# body = fc.body.replace("id=40", "id=" + str(self.mesg[0])). \
# replace("农交", str(self.mesg[1])). \
# replace("18828281176", str(self.mesg[2])). \
# replace("888810054630", str(self.mesg[3])). \
# replace("relationalCard[0].cardNumber=210720131533", "relationalCard[0].cardNumber=210720125142")
# print(body)
re = sy1.post(url=fc.url, headers=fc.header, data=body.encode('utf-8'))
# print(re.headers)
# print(re.json())
self.assertTrue("操作成功" in str(re.json()))
@classmethod
def tearDownClass(cls):
pass
if __name__ == '__main__':
unittest.main()