Exemplo n.º 1
0
 def test_b001_search(self):
     conn = MySQL().connect_portal1('conn')
     cur = conn.cursor()
     cur.execute("select partner_name from partner where `status`=0")
     parnername = str(cur.fetchone()[0])
     url_01 = 'http://admin.ejw.cn/portal/v1/partners?sort=%7B%22gmtCreate%22%3A%22desc%22%7D&status=0&pageNo=1&pageSize=10&partnerName='
     url = url_01+parnername
     # 发送服务商接口请求
     qykh_test_01 = requests.get(url, headers=headers)
     qykh_test = qykh_test_01.text
     # 判断当前返回码及字段值
     self.assertIn(parnername, qykh_test, msg="没有查询到此用户信息")
Exemplo n.º 2
0
 def test_d002_spsq_dsh(self):
     conn = MySQL().connect_platform1('conn')
     cur = conn.cursor()
     cur.execute('select verify_id,product_id from product_verify where `status` = 0')
     cur_data = cur.fetchone()[0:2]
     verify_id = str(cur_data[0])
     product_id = cur_data[1]
     print(verify_id, product_id)
     url_01 = 'http://admin.ejw.cn/platform/v1/productverify/'
     url = url_01 + verify_id
     paramas = {"status": 1}
     result = requests.put(url, data=json.dumps(paramas), headers=headers)
     result_exp = 200
     result_act = result.status_code
     self.assertEqual(result_exp, result_act)
     print("产品审核通过")
Exemplo n.º 3
0
 def test_d001_spsq_dsh(self):
     conn = MySQL().connect_platform1('conn')
     cur = conn.cursor()
     cur.execute('select record_id,auth_id from product_auth where `status`= 3')
     cur_data = cur.fetchone()[0:2]
     record_id = str(cur_data[0])
     auth_id = cur_data[1]
     # print(record_id, auth_id)
     url_01 = 'http://admin.ejw.cn/platform/v1/productauth/'
     url = url_01 + record_id + '/platformverify'
     paramas = {"status": 5}
     result = requests.put(url, data=json.dumps(paramas), headers=headers)
     result_exp = 200
     result_act = result.status_code
     self.assertEqual(result_exp, result_act)
     print("产品授权通过")
Exemplo n.º 4
0
 def test_a004_search(self):
     conn = MySQL().connect_os1('conn')
     cur = conn.cursor()
     cur.execute("select partner_name from partner")
     parnername = str(cur.fetchone()[0])
     url_01 = 'http://admin.ejw.cn/os/v1/partners?pageSize=10&pageNo=1&partnerType=0010%2C0011%2C0100%2C0101%2C0111%2C0110&partnerName='
     url = url_01+parnername
     # 发送服务商接口请求
     qykh_test_01 = requests.get(url, headers=headers)
     qykh_test = qykh_test_01.text
     # 返回状态码信息
     totalCount = qykh_test.split("startRow", 2)[1].split(",", 2)[1].split(":", 2)[1]
     # 判断当前返回码及字段值
     result_act = int(totoalCount)
     result_exp = 1
     self.assertEqual(result_exp, result_act, "查询的日志结果不一致")
Exemplo n.º 5
0
 def test_b005_search(self):
     conn = MySQL().connect_os1('conn')
     cur = conn.cursor()
     cur.execute("select partner_id, partner_name from partner where `status`=0 and partner_type=0001")
     cur_data = cur.fetchone()[0:2]
     # print(cur_data)
     partner_id = str(cur_data[0])
     partner_name = cur_data[1]
     print(partner_id, partner_name)
     paramas = {"status": 1}
     url_01 = 'http://admin.ejw.cn/platform/v1/partner/'
     url = url_01 + partner_id + '/status'
     # 发送服务商接口请求
     shtg = requests.put(url, data=json.dumps(paramas), headers=headers)
     # requests.get("http://admin.ejw.cn/os/v1/partners?sort=%7B%22gmtCreate%22%3A%22desc%22%7D&pageSize=10&pageNo=1&partnerType=0001%2C0011%2C0101%2C0111", headers=headers)
     result_exp = 200
     result_act = shtg.status_code
     self.assertEqual(result_exp, result_act, msg=企业审核不通过)
Exemplo n.º 6
0
    def test_b003_search(self):
        # 随机生成社会信用代码
        uscCode_01 = ''.join(random.sample(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], 10))
        uscCode_02 = '43062419'
        uscCode = uscCode_01 + uscCode_02

        conn = MySQL().connect_portal1('conn')
        cur = conn.cursor()
        cur.execute("select partner_id,partner_name,area,address,phone from partner where `status`=0")
        cur_data = cur.fetchone()[0:5]
        partner_id = str(cur_data[0])
        partner_name = cur_data[1]
        area = cur_data[2]
        address = cur_data[3]
        phone = cur_data[4]
        # print(cur_data, partner_id, partner_name, area, address, phone)

        paramas = {"partnerAudit": {"status": 1, "auditUser": 13},
                   "partner": {"status": 1, "partnerName": partner_name, "area": area, "address": address,
                               "phone": phone,
                               "detail": "", "organizeType": 1, "partnerType": "0001"},
                   "partnerExt": {"standardIndustry": "612"},
                   "partnerQualify": {"qualifyType": 1, "qualifyName": partner_name,
                                      "qualifyValidDate": "2019-05-31T00:00:00+08:00",
                                      "qualifyImage": "https://bj.bcebos.com/v1/dev-con/4c62757db4204f33907aa7eb43c1d6bd.jpg"},
                   "employees": {"status": 1, "sex": 1, "empName": "威胜管理员", "phone": "15074980908", "email": "",
                                 "partnerId": 4},
                   "partnerBusiness": {"organizeName": "威胜电子", "registAuthority": "岳麓区地点", "organizeType": 1,
                                       "uscCode": uscCode, "companyType": "1", "registAddress": "长沙岳麓区",
                                       "legalPerson": "楼想",
                                       "scope": "长沙岳麓区", "issueAuthority": "",
                                       "approvalDate": "2020-05-09T00:00:00+08:00",
                                       "registStatus": "1", "registCapital": 5000}}

        url_01 = 'http://admin.ejw.cn/platform/v1/partner/'
        url = url_01 + partner_id + '/audit'
        # 发送服务商接口请求
        qykh_test_01 = requests.put(url, data=json.dumps(paramas), headers=headers)
        result_act = qykh_test_01.status_code
        result_exp = 200
        # 判断当前返回码及字段值
        self.assertEqual(result_exp, result_act, msg='审核不通过')