def test_flow_9_2(self, flow_9_2):
     """
     提现金额大于商户的可结算余额,小于商户的账面余额未开启超额提现
     """
     PreconditionWithdrawal.mct_update_super_money_pre(is_change=Constants.RESULT.FALSE)  # 关闭超额提现
     PreconditionWithdrawal.mct_update_amount_pre(flow_9_2, set_amt='5000')  # 补充测试商户的余额与可结算余额
     self.err_public(flow_9_2)
 def test_flow_9_6(self, flow_9_6):
     """
     提现金额大于商户的可结算余额,小于商户的账面余额,准备金账户余额不足
     """
     PreconditionWithdrawal.mct_update_super_money_pre(is_change=Constants.RESULT.FALSE)  # 开启超额提现
     PreconditionWithdrawal.mct_update_amount_pre(flow_9_6, set_amt='0')  # 补充测试商户的余额与可结算余额
     PreconditionWithdrawal.mch_update_prepay_amount()  # 设置准备金测试商户的余额和可结算余额
     self.err_public(flow_9_6)
 def test_flow_9_4(self, flow_9_4):
     """
     提现金额大于商户的可结算余额,小于商户的账面余额,准备金账户余额不足
     """
     PreconditionWithdrawal.mct_update_super_money_pre(is_change=Constants.RESULT.TRUE)  # 开启超额提现
     PreconditionWithdrawal.mct_update_amount_pre(flow_9_4, set_amt='5000')  # 补充测试商户的余额与可结算余额
     PreconditionWithdrawal.mch_update_prepay_amount()  # 设置准备金测试商户的余额和可结算余额
     try:
         self.err_public(flow_9_4)
     except Exception as e:
         PreconditionWithdrawal.mct_update_super_money_pre(is_change=Constants.RESULT.FALSE)  # 关闭超额提现
         raise e
     PreconditionWithdrawal.mct_update_super_money_pre(is_change=Constants.RESULT.FALSE)  # 关闭超额提现
 def test_flow_9_3(self, flow_9_3):
     """
     提现金额大于商户的可结算余额,小于商户的账面余额,开启超额提现但没有准备金账户
     """
     PreconditionWithdrawal.mct_update_super_money_pre(is_change=Constants.RESULT.TRUE)  # 开启超额提现
     PreconditionWithdrawal.mct_update_amount_pre(flow_9_3, set_amt='5000')  # 补充测试商户的余额与可结算余额
     PreconditionWithdrawal.mct_promotion_pre(button=Constants.RESULT.FALSE, all=Constants.RESULT.TRUE)  # 清空准备金类型商户
     try:
         self.err_public(flow_9_3)
     except Exception as e:
         PreconditionWithdrawal.mct_update_super_money_pre(is_change=Constants.RESULT.TRUE)  # 关闭超额提现
         PreconditionWithdrawal.mct_promotion_pre(button=Constants.RESULT.TRUE)  # 还原准备金类型商户
         raise e
     PreconditionWithdrawal.mct_update_super_money_pre(is_change=Constants.RESULT.FALSE)  # 关闭超额提现
     PreconditionWithdrawal.mct_promotion_pre(button=Constants.RESULT.TRUE)  # 还原准备金类型商户
Exemplo n.º 5
0
 def test_flow_11(self, flow_9_2):
     """
     商户类型为子商户,无提现手续费,需要借用准备金流程测试
     """
     PreconditionWithdrawal.mct_update_amount_pre(flow_9_2, set_amt='1000')
     self.after_treatment_data = Handle.machaccnt_withdraw_handle(flow_9_2)
     PreconditionWithdrawal.mct_update_super_money_pre(is_change=Constants.RESULT.TRUE)  # 开启超额提现
     kwargs = MachRefundPass.creat_except_data(with_draw_info_index=1, mch_accnt_info_index=1,
                                               his_settled_amount_index=1, propay_index=1)
     try:
         self.flow_pass_public(data=flow_9_2, is_borrow_money=True, is_service_charge=True, type_befor=True,
                               type_after=False, **kwargs)
     except Exception as e:
         PreconditionWithdrawal.mct_update_super_money_pre(is_change=Constants.RESULT.FALSE)  # 关闭超额提现
         raise e
     PreconditionWithdrawal.mct_update_super_money_pre(is_change=Constants.RESULT.FALSE)  # 关闭超额提现
Exemplo n.º 6
0
 def test_flow_10(self, flow_9_1):
     """
     商户类型为子商户,有提现手续费,提现金额大于商户可结算余额,小于商户账面余额,开启超额提现,从准备金账户借款流程测试
     结算金额为负数
     """
     PreconditionWithdrawal.mct_update_amount_pre(flow_9_1, set_amt='-200')
     self.after_treatment_data = Handle.machaccnt_withdraw_handle(flow_9_1)
     PreconditionWithdrawal.mch_update_fixed_poundage(button=Constants.RESULT.TRUE)  # 开启提现手续费
     PreconditionWithdrawal.mct_update_super_money_pre(is_change=Constants.RESULT.TRUE)  # 开启超额提现
     kwargs = MachRefundPass.creat_except_data(with_draw_info_index=1, mch_accnt_info_index=2,
                                               his_settled_amount_index=3, profit_index=1, propay_index=1)
     try:
         self.flow_pass_public(data=flow_9_1, is_borrow_money=True, is_service_charge=True, type_befor=True,
                               type_after=False, **kwargs)
     except Exception as e:
         PreconditionWithdrawal.mch_update_fixed_poundage(button=Constants.RESULT.FALSE)  # 关闭提现手续费
         PreconditionWithdrawal.mct_update_super_money_pre(is_change=Constants.RESULT.FALSE)  # 关闭超额提现
         raise e
     PreconditionWithdrawal.mct_update_super_money_pre(is_change=Constants.RESULT.FALSE)  # 关闭超额提现
     PreconditionWithdrawal.mch_update_fixed_poundage(button=Constants.RESULT.FALSE)  # 关闭提现手续费
Exemplo n.º 7
0
 def test_flow_13(self, flow_9_4):
     """
     商户类型为子商户,有提现手续费,提现金额大于商户可结算余额,小于商户账面余额,开启超额提现,存在多个准备金账户借款流程测试
     测试结果:只会扣减第一个准备金账户
     """
     PreconditionWithdrawal.mct_update_amount_pre(flow_9_4, set_amt='1000')
     PreconditionWithdrawal.mct_promotion_pre(button=Constants.RESULT.TRUE,
                                              all=Constants.RESULT.TRUE)  # 将准备金数量更改至大于1
     self.after_treatment_data = Handle.machaccnt_withdraw_handle(flow_9_4)
     PreconditionWithdrawal.mct_update_super_money_pre(is_change=Constants.RESULT.TRUE)  # 开启超额提现
     kwargs = MachRefundPass.creat_except_data(with_draw_info_index=1, mch_accnt_info_index=1,
                                               his_settled_amount_index=1, propay_index=1)
     try:
         self.flow_pass_public(data=flow_9_4, is_borrow_money=True, is_service_charge=False, type_befor=True,
                               type_after=False, **kwargs)
     except Exception as e:
         PreconditionWithdrawal.mct_update_super_money_pre(is_change=Constants.RESULT.FALSE)  # 关闭超额提现
         PreconditionWithdrawal.mct_promotion_pre(button=Constants.RESULT.TRUE,
                                                  all=Constants.RESULT.TRUE)  # 还原准备金数量
         raise e
     PreconditionWithdrawal.mct_update_super_money_pre(is_change=Constants.RESULT.FALSE)  # 关闭超额提现
     PreconditionWithdrawal.mct_promotion_pre(button=Constants.RESULT.TRUE, all=Constants.RESULT.TRUE)  # 还原准备金数量
Exemplo n.º 8
0
 def test_flow_17(self, flow_9_8):
     """缓存中不存在提现记录,在数据库中存在一条orderid为test1的数据,
     有提现手续费,有准备金借取,重新请求,金额相同。 withdraw_status2。提现完成订单返回 分为status为失败"""
     PreconditionWithdrawal.mct_update_amount_pre(flow_9_8, set_amt='1000')  # 补充测试商户的余额与可结算余额
     # 创造一个提现数据
     self.after_treatment_data = Handle.machaccnt_withdraw_handle(flow_9_8)
     PreconditionWithdrawal.mch_update_fixed_poundage(button=Constants.RESULT.TRUE)  # 开启提现手续费
     PreconditionWithdrawal.mct_update_super_money_pre(is_change=Constants.RESULT.TRUE)  # 开启超额提现
     befor_dic = MachAntWithdrawUp(self.after_treatment_data).amt_expected_results(is_borrow_money=True,
                                                                                   is_service_charge=True,
                                                                                   type=False)
     befor_dic['info_index']['with_draw_info_index'] = 1
     befor_dic['info_index']['mch_accnt_info_index'] = 4  # 提现扣减 手续费扣减 提现退还 手续费退还
     befor_dic['info_index']['his_settled_amount_index'] = 6  # 三条正向操作提现记录 三条退还提现记录
     befor_dic['info_index']['profit_index'] = 2  # 提现增加手续费 退还减少手续费
     befor_dic['info_index']['propay_index'] = 2  # 借准备金记录 还准备金记录
     RequestBase.send_request(**self.after_treatment_data)
     PreconditionWithdrawal.update_pay_url(pay_type='fail')
     PreconditionWithdrawal.send_deal_withdraw()  # 触发提现定时器
     ClearingWithdrawal.redis_clear(self.after_treatment_data)  # 清理缓存记录
     try:
         res, html = RequestBase.send_request(**self.after_treatment_data)  # 发送请求
         self.assertNotEqual(len(html.get('biz_content').get('errmsg')), '交易失败',
                             msg='没有返回数据库以存在的T0020181229204406000002交易失败的信息')
         log.info('本次请求结果为%s' % html)
         aft_dic = MachAntWithdrawUp(self.after_treatment_data).amt_expected_results(is_borrow_money=True,
                                                                                     is_service_charge=True,
                                                                                     type=False)
         excepted = json.loads(self.after_treatment_data['excepted_code'])
         Handle.machaccnt_withdraw_assert(self, html, excepted, befor_dic, aft_dic)
     except Exception as e:
         PreconditionWithdrawal.mch_update_fixed_poundage(button=Constants.RESULT.FALSE)  # 关闭提现手续费
         PreconditionWithdrawal.mct_update_super_money_pre(is_change=Constants.RESULT.TRUE)  # 关闭超额提现
         PreconditionWithdrawal.update_pay_url(pay_type='default')  # 回复默认url地址
         raise e
     PreconditionWithdrawal.mch_update_fixed_poundage(button=Constants.RESULT.FALSE)  # 关闭提现手续费
     PreconditionWithdrawal.mct_update_super_money_pre(is_change=Constants.RESULT.TRUE)  # 关闭超额提现
     PreconditionWithdrawal.update_pay_url(pay_type='default')  # 回复默认url地址