def test_get_normal_account_company(self, platform, with_login): manager = PlatformManager(platform) account_api = manager.account_api user = register_with_login(platform, with_login, [account_api]) social_number = get_random_id_number() company_verify(platform, social_number=social_number, token=user["token"]) res = account_api.accounts_company_get() assert res.social_code[:2] == social_number[:2] assert res.social_code[-2:] == social_number[-2:]
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', 'ENTERPRISE_LICENSE') 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, '企业实名认证不通过,不应当创建交易所'
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_normal_company(self, platform, with_login): user = register_with_login(platform, with_login, []) email = user["email"] social_number = get_random_id_number() # social_number = "123456788" # 进行企业实名认证 company_verify(platform=platform, social_number=social_number, token=user["token"]) api = account_management_api.AccountManagementApi() admin_token = get_admin_token() api.api_client.set_default_header("Authorization", "Bearer " + admin_token) # 通过列表获取账户id investors_resp = api.accounts_investors_get(email=user["email"]) account = investors_resp.items.pop() assert account.email == email user_id = account.account_id company_info = api.accounts_id_company_get(id=user_id) assert company_info.social_code == social_number assert company_info.area == "公司所在区域"
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, '企业未认证通过,不应该创建交易所'
def verify_company(self, social_number, approval): company_verify(platform="staff", social_number=social_number, token=self.token_mgr.token, verify_status=approval, reject_type="INDIVIDUAL_ID")