test_feedback_customer_query.py 1.55 KB
import unittest
import urllib3
from commons.MySession import heb
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()

"""
进门收费——返点管理——返还人管理——返还人列表查询
"""
@unittest.skip
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(heb.user["heb_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 = heb.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()