test_feedback_order_settlement_query.py 1.63 KB
import unittest
import urllib3
from commons.MySession import sy1
from commons.api.feedback_order_settlement_query import feedback_order_settlement_query
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
fosq = feedback_order_settlement_query()
import commons.ConfigDB as db
import datetime

"""
进门收费——返点管理——结账管理——根据返还人和缴费时间进行查询
"""

class test_feedback_order_settlement_query(unittest.TestCase):
    "沈阳——结账管理列表查询——根据返还人和缴费时间进行查询"
    @classmethod
    def setUpClass(cls):
        pass
    def setUp(self):
        self.ids = db.mysql_selectOne('''
        SELECT id FROM `dili_jmsf`.`feedback_customer` WHERE `status` = '1' 
        and market_id = ''' + str(sy1.user["sy_user01"]["firmId"]) + '''
        ORDER BY `id` DESC LIMIT 1''')[0]
        # print(self.ids)
    def test_feedback_order_settlement_query_01(self):
        "根据返还人和缴费时间进行查询"
        print(fosq.url)
        body = fosq.body.replace("feedbackCustomerId=25", "feedbackCustomerId="+str(self.ids)).\
            replace("2021-07-22 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 = fosq.url, data = body,headers = fosq.header)
        # print(re.headers)
        # print(re.json())
        self.assertTrue("rows" in str(re.json()))

    @classmethod
    def tearDownClass(cls):
        pass


if __name__ == '__main__':
    unittest.main()