def test_08api_78dk_platform_mm_state_viewStateMerchantList(self): # 查询商户状态列表 res = PlatformAction.test_api_78dk_platform_mm_state_viewStateMerchantList( '', 0, 10) Assertion.verity(json.loads(res)['code'], '10000') Assertion.verity(json.loads(res)['msg'], '成功')
def test_01api_78dk_platform_tm_first_viewFirstCheckContract(self): # 初审信息查询 # {'uid': '合同uuid'} # contract_uuid = '1e9fe3d0be2344e2acfda1a025a607e2' sql = 'contract_uuid="' + contract_uuid + '" and state ="enabled"' channelid = MysqlClent.select(loginAction.DB, 'Tbl_Contract', condition=sql) # print(type(channelid[0]),channelid[0]) # 查询商户名称 sql = 'id="' + str(channelid[0][4]) + '" and state ="enabled"' merchantname = MysqlClent.select_one(loginAction.DB, 'Tbl_MerchantProfile', 'name', sql) # 查询资金包 sql = 'id="' + str(channelid[0][6]) + '" and state ="enabled"' fundname = MysqlClent.select_one(loginAction.DB, 'Tbl_FundPackage', 'name', sql) print(merchantname, fundname, channelid[0][22]) # fundSideName 资方名称 sql = 'select Tbl_FundSide.name from Tbl_FundSide ,Tbl_FundPackage,Tbl_FundSidePackageRelation WHERE ' \ 'Tbl_FundPackage.id={} and Tbl_FundPackage.id=Tbl_FundSidePackageRelation.fund_package_id and ' \ 'Tbl_FundSide.id=Tbl_FundSidePackageRelation.fund_side_id ;'.format(channelid[0][6]) fundsidename = MysqlClent.executed_one(loginAction.DB, sql) res = PlatformAction.test_api_78dk_platform_tm_first_viewFirstCheckContract( contract_uuid) # # 法大大地址: contract_uuidurl = 'select Tbl_ContractInfo.view_url from Tbl_ContractInfo,Tbl_Contract where ' \ 'Tbl_Contract.contract_uuid=\'{}\' and Tbl_Contract.id=Tbl_ContractInfo.contract_id' \ .format(contract_uuid) contract_uuid1 = MysqlClent.executed_one(loginAction.DB, contract_uuidurl) # # 分数 score = 'select score from Tbl_QifaMachineLog where contract_uuid=\'{}\';'.format( contract_uuid) score1 = MysqlClent.executed_all(loginAction.DB, score) # 查询门店信息 storenamesql = 'select Tbl_Store.business_address from Tbl_Store,Tbl_Contract where ' \ 'Tbl_Contract.storm_id={} and Tbl_Contract.storm_id=Tbl_Store.id and ' \ 'Tbl_Contract.contract_uuid=\'{}\';'.format(channelid[0][5], contract_uuid) storename = MysqlClent.executed_all(loginAction.DB, storenamesql) Assertion.verity(json.loads(res)['msg'], '成功') Assertion.verity(json.loads(res)['code'], '10000') Assertion.verity(json.loads(res)['data']['fddUrl'], contract_uuid1) Assertion.verity( json.loads(res)['data']['earlyRepaymentSupport'], channelid[0][21]) Assertion.verity(json.loads(res)['data']['merchantName'], merchantname) # Assertion.verity(json.loads(res)['data']['aliscore'], '550000.00000000') Assertion.verity( json.loads(res)['data']['contractNumber'], channelid[0][8]) Assertion.verity(json.loads(res)['data']['fundPackageName'], fundname) # Assertion.verity(json.loads(res)['data']['score'], str(score1[0][0])) Assertion.verity(json.loads(res)['data']['fundSideName'], fundsidename) # Assertion.verity(json.loads(res)['data']['repaymentMethod'], 'DBDX') # Assertion.verity(json.loads(res)['data']['storeName'], storename[0][0]) # 查询商户贴息费率 discount_rate discountRatesql = 'select discount_rate FROM Tbl_Contract WHERE contract_uuid="{}" ' \ 'and state ="enabled" '.format(contract_uuid) discountRate = MysqlClent.executed_all(loginAction.DB, discountRatesql) print('bbbbbbbbbbbbbbbbb', discountRate) # Assertion.verity(json.loads(res)['data']['discountRate'], discountRate[0][0]) # 查询产品名称 productNamesql = ' select Tbl_ProductDetail.name from Tbl_ProductDetail,Tbl_Contract where ' \ 'Tbl_Contract.product_id=Tbl_ProductDetail.id and Tbl_Contract.contract_uuid=\'{}\'; ' \ .format(contract_uuid) productName = MysqlClent.executed_all(loginAction.DB, productNamesql) Assertion.verity( json.loads(res)['data']['productName'], productName[0][0]) Assertion.verity(json.loads(res)['data']['aliOpinion'], '网商审核通过') # 查询期数信息 loanPeriodssql = 'SELECT loan_periods FROM Tbl_Contract where contract_uuid=\'{}\';'.format( contract_uuid) loanPeriods = MysqlClent.executed_all(loginAction.DB, loanPeriodssql) Assertion.verity( json.loads(res)['data']['loanPeriods'], loanPeriods[0][0]) # 查询个人基本资料 personsql = 'SELECT tpb.* FROM Tbl_Contract tc, Tbl_ContractPersonBasicRelation tcpr, Tbl_PersonBasicInfo tpb ' \ 'where tc.contract_uuid=\'{}\' and tc.id=tcpr.contract_id and tcpr.person_basic_info_id=tpb.id;' \ .format(contract_uuid) person = MysqlClent.executed_all(loginAction.DB, personsql) # Assertion.verity(json.loads(res)['data']['person'], '个人基本资料') Assertion.verity( json.loads(res)['data']['person']['homeType'], person[0][6]) Assertion.verity( json.loads(res)['data']['person']['idCardNumber'], person[0][3]) Assertion.verity( json.loads(res)['data']['person']['immediateFamilyName'], person[0][7]) Assertion.verity( json.loads(res)['data']['person']['immediateFamilyPhone'], person[0][9]) Assertion.verity( json.loads(res)['data']['person']['immediateFamilyRelation'], person[0][8]) Assertion.verity( json.loads(res)['data']['person']['name'], person[0][2]) Assertion.verity( json.loads(res)['data']['person']['phone'], person[0][4]) Assertion.verity( json.loads(res)['data']['person']['typeOfJob'], person[0][5]) # 查询 overdue_handling_fee_rate 逾期手续费率 - 手续费' overdue_handling_fee_ratesql = 'SELECT overdue_handling_fee_rate FROM Tbl_Contract where contract_uuid=\'{}\';' \ .format(contract_uuid) overdueHandlingFeeRate = MysqlClent.executed_all( loginAction.DB, overdue_handling_fee_ratesql) # Assertion.verity(json.loads(res)['data']['overdueHandlingFeeRate'], overdueHandlingFeeRate[0][0]) # 提前还款手续费 earlyRepaymentHandlingFeesql = 'SELECT early_repayment_handling_fee FROM Tbl_Contract where contract_uuid=\'{}\';' \ .format(contract_uuid) earlyRepaymentHandlingFee = MysqlClent.executed_all( loginAction.DB, earlyRepaymentHandlingFeesql) # Assertion.verity(json.loads(res)['data']['earlyRepaymentHandlingFee'], earlyRepaymentHandlingFee[0][0]) # submit_state submitStatesql = 'SELECT submit_state FROM Tbl_Contract where contract_uuid=\'{}\';'.format( contract_uuid) submitState = MysqlClent.executed_all(loginAction.DB, submitStatesql) # Assertion.verity(json.loads(res)['data']['submitState'], submitState[0][0]) # 用户签订日期查询 signingDatesql = 'SELECT signing_date FROM Tbl_Contract where contract_uuid=\'{}\';'.format( contract_uuid) signingDate = MysqlClent.executed_all(loginAction.DB, signingDatesql) # Assertion.verity(json.loads(res)['data']['signingDate'], signingDate[0][0]) # 查询分期手续费率 精度问题 periodRatesql = 'SELECT period_rate FROM Tbl_Contract where contract_uuid=\'{}\';'.format( contract_uuid) periodRate = MysqlClent.executed_all(loginAction.DB, periodRatesql) # Assertion.verity(json.loads(res)['data']['periodRate'], periodRate[0][0]) # 查询宽限期 gracePeriodsql = 'SELECT grace_period FROM Tbl_Contract where contract_uuid=\'{}\';'.format( contract_uuid) gracePeriod = MysqlClent.executed_all(loginAction.DB, gracePeriodsql) # Assertion.verity(json.loads(res)['data']['gracePeriod'], gracePeriod[0][0]) # 查询贷款金额 loan_amount 精度问题 '20000' != Decimal('20000.00000000') loan_amountsql = 'SELECT loan_amount FROM Tbl_Contract where contract_uuid=\'{}\';'.format( contract_uuid) loanAmount = MysqlClent.executed_all(loginAction.DB, loan_amountsql) # Assertion.verity(json.loads(res)['data']['loanAmount'], loanAmount[0][0]) # 查询 逾期手续费率 - 本金 overduePrincipalRatesql = 'SELECT overdue_principal_rate FROM Tbl_Contract where contract_uuid=\'{}\';'.format( contract_uuid) overduePrincipalRate = MysqlClent.executed_all( loginAction.DB, overduePrincipalRatesql) # Assertion.verity(json.loads(res)['data']['overduePrincipalRate'], overduePrincipalRate[0][0]) # 提前还款周期 earlyRepaymentFreeCyclesql = 'SELECT early_repayment_free_cycle FROM Tbl_Contract where contract_uuid=\'{}\';'.format( contract_uuid) earlyRepaymentFreeCycle = MysqlClent.executed_all( loginAction.DB, earlyRepaymentFreeCyclesql) # 支付宝审核日志 alipayAuditLogssql = 'SELECT talog.opinion,talog.alipay_audit FROM Tbl_Contract tc ,Tbl_AlipayAuditLog talog ' \ 'where tc.contract_uuid=\'{}\' and talog.contract_id=tc.id;'.format(contract_uuid) alipayAuditLogs = MysqlClent.executed_all(loginAction.DB, alipayAuditLogssql) Assertion.verity( json.loads(res)['data']['alipayAuditLogs']['opinion'], alipayAuditLogs[0][0]) # 影响资料信息 contractImagessql = 'SELECT tcim.* FROM Tbl_Contract tc ,Tbl_ContractImage tcim where tc.contract_uuid=\'{}\'' \ ' and tc.id=tcim.contract_id ORDER BY tcim.id ASC;'.format(contract_uuid) contractImages = MysqlClent.executed_all(loginAction.DB, contractImagessql) # 身份证照片(正面) Assertion.verity( json.loads(res)['data']['contractImages'][0]['key'], contractImages[0][4]) Assertion.verity( json.loads(res)['data']['contractImages'][0]['keyName'], contractImages[0][6]) # 身份证照片(反面) Assertion.verity( json.loads(res)['data']['contractImages'][1]['key'], contractImages[1][4]) Assertion.verity( json.loads(res)['data']['contractImages'][1]['keyName'], contractImages[1][6])
def test_07api_78dk_platform_mm_examine_viewExamineMerchantList(self): # 查询商户审核列表 res = PlatformAction.test_api_78dk_platform_mm_examine_viewExamineMerchantList( '', 0, 10) Assertion.verity(json.loads(res)['code'], '10000') Assertion.verity(json.loads(res)['msg'], '成功')
def test_11api_78dk_platform_cm_examine_viewExamineChannels(self): # 渠道审核列表 res = PlatformAction.test_api_78dk_platform_cm_examine_viewExamineChannels( '123', 1, 8) Assertion.verity(json.loads(res)['msg'], '成功') Assertion.verity(json.loads(res)['code'], '10000')
def test_10api_78dk_platform_sys_user_loginpasserror(self): # 用户登录 密码错误 res = PlatformAction.test_api_78dk_platform_sys_user_login(email, '1235456') Assertion.verity(json.loads(res)['code'], '20000') Assertion.verity(json.loads(res)['msg'], '用户名或密码不正确!')
def test_03api_78dk_platform_mm_base_viewMerchantList(self): # 查询商户列表 res = PlatformAction.test_api_78dk_platform_mm_base_viewMerchantList( 0, 10, merchantname) Assertion.verity(json.loads(res)['code'], '10000') Assertion.verity(json.loads(res)['msg'], '成功')
def test_08api_78dk_platform_cm_state_updateOpenCloseState_open(self): # 渠道开关状态为open res = PlatformAction.test_api_78dk_platform_cm_state_updateOpenCloseState( uid=self.channelid, updatestate='open') Assertion.verity(json.loads(res)['msg'], '成功') Assertion.verity(json.loads(res)['code'], '10000')
def test_04api_78dk_platform_sys_user_viewSystemUser(self): # 查询用户 res2 = PlatformAction.test_api_78dk_platform_sys_user_viewSystemUser(user_uuid) Assertion.verity(json.loads(res2)['code'], '10000') Assertion.verity(json.loads(res2)['msg'], '成功')
def test_07api_78dk_platform_sys_user_login2(self): # 离职状态 用户登录 res = PlatformAction.test_api_78dk_platform_sys_user_login(email, '123456') print(json.loads(res)) Assertion.verity(json.loads(res)['code'], '20000') Assertion.verity(json.loads(res)['msg'], '你已经离职,不能再登陆')
def test_26api_78dk_platform_sys_user_saveSystemUser(self): # 新增用户 手机号错误 12 res = PlatformAction.test_api_78dk_platform_sys_user_saveSystemUser(email4, '43543234566', name4) # print(json.loads(res)) Assertion.verity(json.loads(res)['code'], '20000') Assertion.verity(json.loads(res)['msg'], '手机格式不合法,')
def test_01api_78dk_platform_sys_user_saveSystemUser(self): # 新增用户 res = PlatformAction.test_api_78dk_platform_sys_user_saveSystemUser(email=email, name=name, mobile=phone) print(res) Assertion.verity(json.loads(res)['code'], '10000') Assertion.verity(json.loads(res)['msg'], '成功')
def test_23api_78dk_platform_sys_user_saveSystemUser(self): # 新增用户不是email res = PlatformAction.test_api_78dk_platform_sys_user_saveSystemUser('gggggggggg', name4, phone4) # print(json.loads(res)) Assertion.verity(json.loads(res)['code'], '20000') Assertion.verity(json.loads(res)['msg'], '手机格式不合法,邮箱的格式不合法,')
def test_21api_78dk_platform_sys_user_saveSystemUser(self): # 新增 相同email,phone,name用户 res = PlatformAction.test_api_78dk_platform_sys_user_saveSystemUser(email, name, phone) Assertion.verity(json.loads(res)['code'], '20000') Assertion.verity(json.loads(res)['msg'], '邮箱【{}】已经存在!'.format(email))
def test_11api_78dk_platform_sys_user_loginusererror(self): # 用户登录 账号错误 res = PlatformAction.test_api_78dk_platform_sys_user_login('*****@*****.**', '1235456') Assertion.verity(json.loads(res)['code'], '20000') Assertion.verity(json.loads(res)['msg'], '用户名或密码不正确!')
def test_28api_78dk_platform_mm_base_store_viewStoreList(self): # 查询商户门店列表 res = PlatformAction.test_api_78dk_platform_mm_base_store_viewStoreList( '', 1, 10) Assertion.verity(json.loads(res)['code'], '10000') Assertion.verity(json.loads(res)['msg'], '成功')
def test_01api_78dk_platform_fund_fundSide_saveFundSide(self): # 添加资方 res = PlatformAction.test_api_78dk_platform_fund_fundSide_saveFundSide(FundSidename, 'enabled') Assertion.verity(json.loads(res)['code'], '10000') Assertion.verity(json.loads(res)['msg'], '成功')
def test_34api_78dk_platform_mm_money_viewMerchantMoneyList(self): # 风险控制列表 res = PlatformAction.test_api_78dk_platform_mm_money_viewMerchantMoneyList( 1, 999, '商户名') Assertion.verity(json.loads(res)['code'], '10000') Assertion.verity(json.loads(res)['msg'], '成功')
def test_04api_78dk_platform_fund_fundSide_viewFundSides(self): # 资方列表 res = PlatformAction.test_api_78dk_platform_fund_fundSide_viewFundSides(1, FundSidename, 10, 'enabled') Assertion.verity(json.loads(res)['code'], '10000') Assertion.verity(json.loads(res)['msg'], '成功')
def saveMerchant(channel_name, account_name, LegalPerson_name, business_email, merchant_name, manager_name): # 与产品绑定的商户 # 新增商户 sql = 'name="' + channel_name + '" and state ="enabled"' channelid = MysqlClent.select_one(loginAction.DB, 'Tbl_ChannelProfile', 'channel_uuid', sql) PlatformAction.test_api_78dk_platform_mm_base_saveMerchant( note='备注', name=merchant_name, parentmerchantuuid='', shortname=merchant_name, channeluuid=channelid) # 审核通过 sql1 = 'name="' + merchant_name + '" and state ="enabled"' merchant_uuid = MysqlClent.select_one(loginAction.DB, 'Tbl_MerchantProfile', 'merchant_uuid', sql1) PlatformAction.test_api_78dk_platform_mm_examine_merchanrExamine( uid=merchant_uuid, ispass='******', message='通过') # 新增机构 sql1 = 'name="' + merchant_name + '" and state ="enabled"' merchant_uuid = MysqlClent.select_one(loginAction.DB, 'Tbl_MerchantProfile', 'merchant_uuid', sql1) res = PlatformAction.test_api_78dk_platform_mm_base_business_saveBusinessInfor( businessaddress='天府软件园', businessaddressgpsloction='天府软件园GPS地址', businessaddresszipcode='000000', businesshoursendtime='18:30', businesshoursstarttime='08:30', businessinformationuuid=merchant_uuid, businessregistrationnumber='443534534543', channelormerchantuuid=merchant_uuid, documentaddress='天府软件园', email=business_email, organizationcode='567657675765', socialunifiedcreditcode='34534543534', storerentalendtime='2019-01-12', storerentalstarttime='2018-01-12', taxregistrationnumber='34543543543', documentprovince=510000, documentcity=510100, documentregion=510104, documentprovincename='', documentcityname='', documentregionname='', businessprovince=510000, businesscity=510100, businessregion=510104, businessprovincename='', businesscityname='', businessregionname='') Assertion.verity(json.loads(res)['code'], '10000') Assertion.verity(json.loads(res)['msg'], '成功') # 添加法人 cardnumber, channelormerchantuuid, legalpersonuuid, mobile, name sql = 'name="' + merchant_name + '" and state ="enabled"' merchant_uuid = MysqlClent.select_one(loginAction.DB, 'Tbl_MerchantProfile', 'merchant_uuid', sql) res = PlatformAction.test_api_78dk_platform_mm_base_legal_saveLegalPerson( cardnumber='123456', channelormerchantuuid=merchant_uuid, legalpersonuuid='', mobile='18911390729', name=LegalPerson_name) Assertion.verity(json.loads(res)['code'], '10000') Assertion.verity(json.loads(res)['msg'], '成功') # 为商户添加结算信息 sql = 'name="' + merchant_name + '" and state ="enabled"' merchant_uuid = MysqlClent.select_one(loginAction.DB, 'Tbl_MerchantProfile', 'merchant_uuid', sql) res = PlatformAction.test_api_78dk_platform_mm_base_clear_saveClearingAccount( accountname=account_name, accountnumber='6011826564542944', accountopeningbank='农业银行', accounttype='public_accounts', branchname='支行名称', chamberlainidcard='431081199812097872', channelormerchantuuid=merchant_uuid, city=510100, clearingaccountuuid='', linenumber='6756765756', phone='15179366892', province=510000, region=510101) Assertion.verity(json.loads(res)['code'], '10000') Assertion.verity(json.loads(res)['msg'], '成功') # 为商户新增门店 sql = 'name="' + merchant_name + '" and state ="enabled"' merchant_uuid = MysqlClent.select_one(loginAction.DB, 'Tbl_MerchantProfile', 'merchant_uuid', sql) res = PlatformAction.test_api_78dk_platform_mm_base_store_saveStore( businessaddress='经营地址', businessaddressgpsloction='GPS地址', managername=manager_name, managerphone='18911390729', merchantuuid=merchant_uuid, storeuuid="storeName5555555555", storename='', province=510000, city=510100, region=510104, provincename='', cityname='', regionname='') Assertion.verity(json.loads(res)['code'], '10000') Assertion.verity(json.loads(res)['msg'], '成功') # 新增额度管理 sql = 'name="' + merchant_name + '" and state ="enabled"' merchant_uuid = MysqlClent.select_one(loginAction.DB, 'Tbl_MerchantProfile', 'merchant_uuid', sql) res = PlatformAction.test_api_78dk_platform_mm_money_saveMerchantMoney( amountday=150000, amountmonth=3000000, amountsingle=30000, amountsum=5000000, merchantuuid=merchant_uuid, moneyconfiguuid='', zoomcoefficient=0) Assertion.verity(json.loads(res)['code'], '10000') Assertion.verity(json.loads(res)['msg'], '成功') return merchant_name
def test_08api_78dk_platform_fund_fundPackage_viewFundPackages(self): # 查询资金包列表 res = PlatformAction.test_api_78dk_platform_fund_fundPackage_viewFundPackages(1, 10, FundPackagename) Assertion.verity(json.loads(res)['code'], '10000') Assertion.verity(json.loads(res)['msg'], '成功')
def test_09api_78dk_platform_cm_examine_examine_true(self): # 渠道审核通过 res = PlatformAction.test_api_78dk_platform_cm_examine_examine( isadopt='true', message='通过', uid=self.channelid) Assertion.verity(json.loads(res)['msg'], '成功') Assertion.verity(json.loads(res)['code'], '10000')
def test_09api_78dk_platform_tm_first_viewImageDataConfig(self): # #查询影像列表 res = PlatformAction.test_api_78dk_platform_tm_first_viewImageDataConfig( subdivisiontype='subdivision_type_home_installment') Assertion.verity(json.loads(res)['msg'], '成功') Assertion.verity(json.loads(res)['code'], '10000')
def test_12api_78dk_platform_cm_examine_viewExamineChannels_all(self): # 渠道审核列表全部 res = PlatformAction.test_api_78dk_platform_cm_examine_viewExamineChannels( name='', pagecurrent=1, pagesize=8) Assertion.verity(json.loads(res)['msg'], '成功') Assertion.verity(json.loads(res)['code'], '10000')
def test_09api_78dk_platform_sys_user_login(self): # 启用 用户登录成功 res = PlatformAction.test_api_78dk_platform_sys_user_login(email, '1') Assertion.verity(json.loads(res)['code'], '10000') Assertion.verity(json.loads(res)['msg'], '成功')