test_feedbackOrderController_settlementlist.py 1.61 KB
import unittest
import urllib3
from commons.MySession import my,sy1
from commons.api.sy.feedbackOrderController_settlementlist import feedbackOrderController_settlementlist
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
import commons.ConfigDB as db
import datetime
focsl = feedbackOrderController_settlementlist()

"""
进门收费——返点管理——已结账明细——返还笔数结账时间金额查询
"""

class test_feedbackOrderController_settlementlist(unittest.TestCase):
    "沈阳——已结账明细——根据返还人和结算时间进行查询"
    @classmethod
    def setUpClass(cls):
        pass
    def setUp(self):
        self.idf = 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]

    def test_feedbackOrderController_settlementlist_01(self):
        "根据返还人和结算时间进行查询"
        body = focsl.body.replace("2021-08-04 00:00:00", (datetime.datetime.now() - datetime.timedelta(days = 30)).strftime("%Y-%m-%d %H:%M:%S")).\
            replace("2021-08-05 23:59:59", datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")).\
            replace("feedbackCustomerId=25", "feedbackCustomerId="+str(self.idf))
        # print(body)
        re = sy1.post(url=focsl.url, data=body.replace("\n",""), headers=focsl.header,proxies = my.proxies)
        self.assertEqual(re.status_code, 200)
        # print(re.json())

    @classmethod
    def tearDownClass(cls):
        pass


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