test_feedback_customer_query.py
1.49 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
import unittest
import urllib3
from commons.MySession import my,sy1
from commons.api.feedback_customer_query import feedback_customer_query
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
import datetime
import commons.ConfigDB as db
fcq = feedback_customer_query()
"""
进门收费——返点管理——返还人管理——返还人列表查询
"""
class test_feedback_customer_query(unittest.TestCase):
"返还人管理——返还人列表查询"
@classmethod
def setUpClass(cls):
pass
def setUp(self):
self.name1 = db.mysql_selectOne('''SELECT name FROM `dili_jmsf`.`feedback_customer`
WHERE market_id = ''' + str(sy1.user["sy_user01"]["firmId"]) + ''' ORDER BY `id` DESC LIMIT 1''')[0]
def test_feedback_customer_query_01(self):
print(fcq.url)
body = fcq.body\
.replace("潘婷婷", str(self.name1))\
.replace("2021-08-11 00:00:00",(datetime.datetime.now() - datetime.timedelta(days = 30)).strftime("%Y-%m-%d %H:%M:%S")).\
replace("2021-08-11 23:59:59",datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
# print(body)
re = sy1.post(url = fcq.url, data = body.replace("\n","").encode('utf-8'),headers = fcq.header)
# print(re.headers)
# print(re.text)
# print("士大夫十",str(self.name1))
self.assertTrue(str(self.name1) in str(re.text))
@classmethod
def tearDownClass(cls):
pass
if __name__ == '__main__':
unittest.main()