test_feedback_customer_query.py
1.37 KB
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-07-02 00:00:00",(datetime.datetime.now() - datetime.timedelta(days = 30)).strftime("%Y-%m-%d %H:%M:%S")).\
replace("2021-08-03 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,proxies = my.proxies)
# print(re.headers)
# print(re.text)
self.assertTrue(str(self.name1) in str(re.text))
@classmethod
def tearDownClass(cls):
pass
if __name__ == '__main__':
unittest.main()