Commit b2316d075c039a470d3798549999d204c58dda57

Authored by wenleiming
1 parent ffac2300

用例修改

commons/api/feedback_customer_disable.py
... ... @@ -18,8 +18,7 @@ class feedback_customer_disable():
18 18 "User-Agent": "Mozilla/5.0(WindowsNT6.2;WOW64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/84.0.4147.105Safari/537.36",
19 19 "Accept-Language": "zh-CN,zh;q=0.9",
20 20 "Referer": "http://test.jmsf.diligrp.com:8385/FeedbackCustomerController/list",
21   - "Accept-Encoding": "gzip,deflate",
22   - "Cookie": "UAP_accessToken=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJXRUIiLCJuYmYiOjE2Mjc5NTE5MzEsImRhdGEiOiJ7XCJjZWxscGhvbmVcIjpcIjE1NTI2MzY0NDU2XCIsXCJjcmVhdGVkXCI6MTYwODc5NTk0OTAwMCxcImRlcGFydG1lbnRJZFwiOjU2LFwiZW1haWxcIjpcInNoZW55YW5nQGRpbGlncnAuY29tXCIsXCJmaXJtQ29kZVwiOlwic3lcIixcImZpcm1JZFwiOjksXCJmaXJtTmFtZVwiOlwi5rKI6Ziz5Zyw5Yip5Yac5om55biC5Zy65a6i5oi355S15a2Q57uT566X5Lit5b-DXCIsXCJpZFwiOjI1MSxcImxhc3RMb2dpblRpbWVcIjoxNjI3OTUxOTMwOTY3LFwibWV0YWRhdGFcIjp7fSxcIm1vZGlmaWVkXCI6MTYyNjE2MzAwNDAwMCxcInBhc3N3b3JkXCI6XCIxODk2NUVCNzJDOTJBNTQ5RERcIixcInJlYWxOYW1lXCI6XCLmsojpmLNcIixcInNlcmlhbE51bWJlclwiOlwiMDAwXCIsXCJzdGF0ZVwiOjEsXCJzeXN0ZW1UeXBlXCI6MSxcInVzZXJOYW1lXCI6XCI0NDQ0NDRcIixcInVzZXJUeXBlXCI6MX0iLCJpc3MiOiJVQVBfQVVUSDAiLCJleHAiOjE2Mjc5NTM3MzEsImlhdCI6MTYyNzk1MTkzMSwianRpIjoiMGM1ZjljMjAtMjIyOC00YzllLTljYTQtMDA1OTMyYjg2YmVhIn0.V8ptydt5ueigxhWIZ8yWJpOr15xM1R5qjqRnkDLfaaRg4MerzIXf6z82f04hLLqlrJva4VC4DFzsVjkq_-V8RMvYOrGpdBCcDCHzp6X82IvhfJsUZ6yyrrKsCxXvi1FHHGMZhBe61z0K8r0yM56dl1Dyxujo5L7L-idWKWpbwkk;UAP_refreshToken=b019119d-600f-4f4c-92b7-c2a281b24e03;UAP_firmId=9"
  21 + "Accept-Encoding": "gzip,deflate"
23 22 }
24 23  
25 24 def __init__(self):
... ...
commons/api/feedback_customer_enable.py
... ... @@ -18,8 +18,7 @@ class feedback_customer_enable():
18 18 "User-Agent": "Mozilla/5.0(WindowsNT6.2;WOW64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/84.0.4147.105Safari/537.36",
19 19 "Accept-Language": "zh-CN,zh;q=0.9",
20 20 "Referer": "http://test.jmsf.diligrp.com:8385/FeedbackCustomerController/list",
21   - "Accept-Encoding": "gzip,deflate",
22   - "Cookie": "UAP_accessToken=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJXRUIiLCJuYmYiOjE2Mjc5NTE5MzEsImRhdGEiOiJ7XCJjZWxscGhvbmVcIjpcIjE1NTI2MzY0NDU2XCIsXCJjcmVhdGVkXCI6MTYwODc5NTk0OTAwMCxcImRlcGFydG1lbnRJZFwiOjU2LFwiZW1haWxcIjpcInNoZW55YW5nQGRpbGlncnAuY29tXCIsXCJmaXJtQ29kZVwiOlwic3lcIixcImZpcm1JZFwiOjksXCJmaXJtTmFtZVwiOlwi5rKI6Ziz5Zyw5Yip5Yac5om55biC5Zy65a6i5oi355S15a2Q57uT566X5Lit5b-DXCIsXCJpZFwiOjI1MSxcImxhc3RMb2dpblRpbWVcIjoxNjI3OTUxOTMwOTY3LFwibWV0YWRhdGFcIjp7fSxcIm1vZGlmaWVkXCI6MTYyNjE2MzAwNDAwMCxcInBhc3N3b3JkXCI6XCIxODk2NUVCNzJDOTJBNTQ5RERcIixcInJlYWxOYW1lXCI6XCLmsojpmLNcIixcInNlcmlhbE51bWJlclwiOlwiMDAwXCIsXCJzdGF0ZVwiOjEsXCJzeXN0ZW1UeXBlXCI6MSxcInVzZXJOYW1lXCI6XCI0NDQ0NDRcIixcInVzZXJUeXBlXCI6MX0iLCJpc3MiOiJVQVBfQVVUSDAiLCJleHAiOjE2Mjc5NTM3MzEsImlhdCI6MTYyNzk1MTkzMSwianRpIjoiMGM1ZjljMjAtMjIyOC00YzllLTljYTQtMDA1OTMyYjg2YmVhIn0.V8ptydt5ueigxhWIZ8yWJpOr15xM1R5qjqRnkDLfaaRg4MerzIXf6z82f04hLLqlrJva4VC4DFzsVjkq_-V8RMvYOrGpdBCcDCHzp6X82IvhfJsUZ6yyrrKsCxXvi1FHHGMZhBe61z0K8r0yM56dl1Dyxujo5L7L-idWKWpbwkk;UAP_refreshToken=b019119d-600f-4f4c-92b7-c2a281b24e03;UAP_firmId=9"
  21 + "Accept-Encoding": "gzip,deflate"
23 22 }
24 23 def __init__(self):
25 24 self.url = feedback_customer_enable.url.replace("http://test.", com.get_global_config("global_data", "environment", "en"))
... ...
commons/api/feedback_customer_query.py
... ... @@ -24,7 +24,6 @@ class feedback_customer_query():
24 24 "Referer": "http://test.jmsf.diligrp.com:8385/FeedbackCustomerController/list",
25 25 "Accept-Encoding": "gzip,deflate",
26 26 "Content-Type": "application/x-www-form-urlencoded",
27   - "Cookie": "UAP_accessToken=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJXRUIiLCJuYmYiOjE2Mjc5NTE5MzEsImRhdGEiOiJ7XCJjZWxscGhvbmVcIjpcIjE1NTI2MzY0NDU2XCIsXCJjcmVhdGVkXCI6MTYwODc5NTk0OTAwMCxcImRlcGFydG1lbnRJZFwiOjU2LFwiZW1haWxcIjpcInNoZW55YW5nQGRpbGlncnAuY29tXCIsXCJmaXJtQ29kZVwiOlwic3lcIixcImZpcm1JZFwiOjksXCJmaXJtTmFtZVwiOlwi5rKI6Ziz5Zyw5Yip5Yac5om55biC5Zy65a6i5oi355S15a2Q57uT566X5Lit5b-DXCIsXCJpZFwiOjI1MSxcImxhc3RMb2dpblRpbWVcIjoxNjI3OTUxOTMwOTY3LFwibWV0YWRhdGFcIjp7fSxcIm1vZGlmaWVkXCI6MTYyNjE2MzAwNDAwMCxcInBhc3N3b3JkXCI6XCIxODk2NUVCNzJDOTJBNTQ5RERcIixcInJlYWxOYW1lXCI6XCLmsojpmLNcIixcInNlcmlhbE51bWJlclwiOlwiMDAwXCIsXCJzdGF0ZVwiOjEsXCJzeXN0ZW1UeXBlXCI6MSxcInVzZXJOYW1lXCI6XCI0NDQ0NDRcIixcInVzZXJUeXBlXCI6MX0iLCJpc3MiOiJVQVBfQVVUSDAiLCJleHAiOjE2Mjc5NTM3MzEsImlhdCI6MTYyNzk1MTkzMSwianRpIjoiMGM1ZjljMjAtMjIyOC00YzllLTljYTQtMDA1OTMyYjg2YmVhIn0.V8ptydt5ueigxhWIZ8yWJpOr15xM1R5qjqRnkDLfaaRg4MerzIXf6z82f04hLLqlrJva4VC4DFzsVjkq_-V8RMvYOrGpdBCcDCHzp6X82IvhfJsUZ6yyrrKsCxXvi1FHHGMZhBe61z0K8r0yM56dl1Dyxujo5L7L-idWKWpbwkk;UAP_refreshToken=b019119d-600f-4f4c-92b7-c2a281b24e03;UAP_firmId=9"
28 27 }
29 28  
30 29 body = '''rows=10&page=1&sort=id&order=desc&metadata[created]=[provider=datetimeProvider&index=10&field=created]
... ...
testcase/FeedbackCustomerController/feedback_customer_disable.py
... ... @@ -4,6 +4,7 @@ from commons.MySession import sy1
4 4 from commons.api.feedback_customer_disable import feedback_customer_disable
5 5 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
6 6 fcd = feedback_customer_disable()
  7 +import commons.ConfigDB as db
7 8  
8 9 class test_fc_add(unittest.TestCase):
9 10 "返还人禁用"
... ... @@ -11,9 +12,13 @@ class test_fc_add(unittest.TestCase):
11 12 def setUpClass(cls):
12 13 pass
13 14  
14   - def test_fc_add_01(self):
  15 + def setUp(self):
  16 + self.id = db.mysql_selectOne("SELECT * FROM `dili_jmsf`.`feedback_customer` WHERE `status` = '1' ORDER BY `id` DESC LIMIT 1")[0]
  17 + print("查询出返还人id", self.id)
15 18  
16   - re = sy1.post(url=fcd.url, headers=fcd.header)
  19 + def test_fc_add_01(self):
  20 + url = fcd.url.replace("44", str(self.id))
  21 + re = sy1.post(url=url, headers=fcd.header)
17 22 print(re.headers)
18 23 print(re.json())
19 24 self.assertTrue("操作成功" in str(re.json()))
... ...
testcase/FeedbackCustomerController/feedback_customer_enable.py
... ... @@ -4,6 +4,7 @@ from commons.MySession import sy1
4 4 from commons.api.feedback_customer_enable import feedback_customer_enable
5 5 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
6 6 fce = feedback_customer_enable()
  7 +import commons.ConfigDB as db
7 8  
8 9 class test_fc_add(unittest.TestCase):
9 10 "返还人启用"
... ... @@ -11,9 +12,13 @@ class test_fc_add(unittest.TestCase):
11 12 def setUpClass(cls):
12 13 pass
13 14  
  15 + def setUp(self):
  16 + self.id = db.mysql_selectOne("SELECT * FROM `dili_jmsf`.`feedback_customer` WHERE `status` = '2' ORDER BY `id` DESC LIMIT 1")[0]
  17 + print(self.id)
14 18 def test_fc_add_01(self):
15 19  
16   - re = sy1.post(url = fce.url, headers = fce.header)
  20 + url = fce.url.replace("49",str(self.id))
  21 + re = sy1.post(url = url, headers = fce.header)
17 22 print(fce.url)
18 23 print(re.headers)
19 24 print(re.json())
... ...
testcase/FeedbackCustomerController/feedback_customer_query.py
... ... @@ -13,10 +13,13 @@ class test_feedback_customer_query(unittest.TestCase):
13 13  
14 14 def test_feedback_customer_query_01(self):
15 15 print(fcq.url)
16   - re = sy1.post(url = fcq.url, data = fcq.body.encode('utf-8'),headers = fcq.header,proxies=my.myproxies)
  16 + body = fcq.body.replace("史芳", "孟莹").replace("2021-07-02 00:00:00","\
  17 + 2021-08-02 00:00:00").replace("2021-08-03 23:59:59", "2021-08-08 23:59:59")
  18 +
  19 + re = sy1.post(url = fcq.url, data = body.encode('utf-8'),headers = fcq.header,proxies=my.myproxies)
17 20 print(re.headers)
18 21 print(re.json())
19   - self.assertTrue("史芳" in str(re.json()))
  22 + self.assertTrue("孟莹" in str(re.json()))
20 23  
21 24 @classmethod
22 25 def tearDownClass(cls):
... ...
testcase/FeedbackOrderController/feedback_order_settlement_query.py
... ... @@ -13,7 +13,11 @@ class test_feedback_order_settlement_query(unittest.TestCase):
13 13  
14 14 def test_feedback_order_settlement_query_01(self):
15 15 print(fosq.url)
16   - re = sy1.post(url = fosq.url, data = fosq.body.encode('utf-8'),headers = fosq.header,proxies=my.myproxies)
  16 + body = fosq.body.replace("25", "16").replace("2021-07-22 00:00:00", "\
  17 + 2021-07-03 00:00:00").replace("2021-08-03 23:59:59", "2021-08-03 23:59:59")
  18 +
  19 +
  20 + re = sy1.post(url = fosq.url, data = body,headers = fosq.header,proxies=my.myproxies)
17 21 print(re.headers)
18 22 print(re.json())
19 23 self.assertTrue("新爱心园婚介所的总公司" in str(re.json()))
... ...