def get_company_apply_list(audit_api: AuditApi, social_code: str) -> list:
    """
    获取指定公司的待审核的实名认证列表
    :param audit_api: 借口实例化对象
    :param social_code: 社会统一编号
    :return:
    """
    resp = audit_api.accounts_company_audits_get(social_number=social_code,
                                                 status="APPLIED")
    return [item.id for item in resp.items]
Beispiel #2
0
 def test_apply_company_verify(self, with_login):
     exchange_api = ExchangeManagementApi()
     user = self.data['user']
     email, password = user['email'], user['password']
     social_code = get_social_code()
     token = with_login('tenant', [exchange_api], email, password)
     company_verify('tenant', social_code, token)
     a_api = AuditApi()
     admin_token = get_admin_token()
     set_login_status(a_api, admin_token)
     rv = a_api.accounts_company_audits_get(social_number=social_code,
                                            status='ACCEPTED')
     item = rv.items[0]
     account_id = item.account_id
     rv = a_api.accounts_company_audits_id_get(account_id)
     assert rv.account_id == account_id
     e = Exchange(exchange_api, token)
     exchange = e.get_exchange()
     exchange_api.exchange_post(exchange)
 def test_apply_company_verify(self, with_login):
     exchange_api = ExchangeManagementApi()
     user = self.data['user']
     email, password = user['email'], user['password']
     social_code = get_social_code()
     token = with_login('tenant', [exchange_api], email, password)
     company_verify('tenant', social_code, token, 'REJECTED', 'INDIVIDUAL_PASSPORT')
     a_api = AuditApi()
     admin_token = get_admin_token()
     set_login_status(a_api, admin_token)
     rv = a_api.accounts_company_audits_get(social_number=social_code,
                                            status='REJECTED')
     item = rv.items[0]
     account_id = item.account_id
     rv = a_api.accounts_company_audits_id_get(account_id)
     assert rv.account_id == account_id
     e = Exchange(exchange_api, token)
     exchange = e.get_exchange()
     try:
         exchange_api.exchange_post(exchange)
     except ApiException as e:
         assert e.status == 400
     else:
         assert False, '企业未认证通过,不应该创建交易所'