def get_token(get_code): information = { 'name': 'passport.userinfo.bycode', 'data': { "code": get_code }, 'api': "/passport/api", 'method': 'post' } result = DisposeData(information).response_() return result.get('value').get('token')
def test_add_position(get_token, random_massage): information = { 'name': 'old_add_position', 'param': { 'name': random_massage['job'], 'propertyCode': random_massage['number(1-3)'] }, 'api': "/http/saas/position/add.json", 'method': 'post' } response = DisposeData(information, get_token).response_() return response.get('data')
def test_add_department(random_massage, get_token): information = { 'name': "old_add_department", 'param': { 'name': str(random_massage['job']).replace("/", ""), 'departmentTypeCode': random_massage['number(1-2)'] }, 'api': "/http/saas/department/addTopDept.json", 'method': 'post' } result = DisposeData(information, get_token).response_() return result.get('data')
def get_code(): information = { 'name': 'passport.login.security', 'data': { "account": "18888888888", "password": "******", "returnUrl": "", "captcha": "" }, 'api': "/passport/api", 'method': 'post' } result = DisposeData(information).response_() return result.get('value').split('=')[1]
def test_add_employee(self, get_token, random_massage): information = { 'name': 'passport.employee.add', 'data': { 'name': random_massage['name'], 'email': '', 'gender': 0, 'mobile': random_massage['mobile'], 'deptIds': [20], # 'deptIds': [test_add_department], 'married': '', 'roleIds': [], 'joinDate': '2019-11-27', 'managers': [0], 'education': 2, 'documentNo': random_massage['ID_card'], 'employeeNo': '', # 'positionId': test_add_position, 'positionId': 1, 'defaultDept': '', 'documentType': 2 }, 'api': '/passport/api', 'method': 'post' } DisposeData(information, get_token).response_()
def test_add_new_product(self, get_token, test_add_new_product): information = { 'name': 'npdc.product.shelf', 'data': { "no": test_add_new_product['productNo'], "releaseStatus": 1 }, 'api': '/npdc-web/api', 'method': 'post' } DisposeData(information, get_token).response_()
def test_add_new_product(get_token, random_massage): information = { 'name': 'npdc.producthandle.add', 'data': { "templateId": 57, # 客户模版14,测试环境57 "objProductDtoList": [{ "objNo": "NPDC-TRUST-BASE-MESSAGE", "info": { "name": "接口自动化" + str(random_massage['number(1-400)']), "minBuyMoney": "", "productDeadline": "", "Issuer": "", "issuePlace": "", "incomeDistributionMode": "", "issueTime": "", "publishScale": "", "establishmentDate": "", "establish": "", "durationType": "", "expectEarningRate": "", "expectRateDescription": "", "profitType": "", "investmentType": "", "fundCustodianBank": "", "InvestmentField": "", "investmentProjectLocation": "", "productFeatures": "", "financier": "", "repaymentSource": "", "resourceUse": "", "riskControl": "", "assetManager": "", "IssuerStr": "爱建信托" }, "productNo": "" }, { "objNo": "NPDC-SALE-CONFIG", "productNo": "", "info": { "visibleScope": { "faDept": [], "faPosition": [], "faTag": [], "customerTag": [], "faScope": -1, "ifaScope": -1, "customerScope": -1 }, "status": 1, "statusForReservation": [1], "advisorShareConfig": 1, "modifyAfterStatus": '', "modifyTime": "", "modifyStatus": [], "riskLevel": 1, "statusStr": "预热中", "advisorShareConfigStr": "可分享", "statusForReservationStr": "预热中", "riskLevelStr": "R1" } }], "categoryId": 1848 # 客户环境25,测试环境 1848 }, 'api': '/npdc-web/api', 'method': 'post' } # DisposeData(information, get_token).response_() details = { 'productName': information['data']['objProductDtoList'][0]['info']['name'], 'productNo': DisposeData(information, get_token).response_()['value']['productNo'] } return details