def test_exchange_post(self, with_login): audit_api = AuditApi() user = self.data['user'] email = user['email'] password = user['password'] exchange_api = ExchangeManagementApi() e_api = ExchangeApi() f_api = FavoriteManagementApi() token = with_login('tenant', [exchange_api, e_api, f_api], email, password) id_number = get_random_id_number() individual_verify('tenant', id_number, token) e = Exchange(exchange_api, token) exchange = e.get_exchange() exchange_api.exchange_post(exchange) rv = exchange_api.exchange_exchange_status_get() assert rv.status == 'pending' admin_token = get_admin_token() set_login_status(audit_api, admin_token) # 初审 uid = self.data['account_id'] rv = audit_api.tenant_audits_get(uid=uid, exchange_name=exchange.name, type='audit') task = rv.items[0] task_id = task.id res = PostTenantAuditRequest(id=task_id, is_data_received=True, status='approved') audit_api.tenant_audits_audit_post(res) # 初审详情 rv = audit_api.tenant_audits_results_id_company_audit_get(task_id) assert rv.audit_status == 'approved' assert rv.uid == uid # 复审 res = PostTenantReAuditRequest(id=task_id, status='disapproved') audit_api.tenant_audits_re_audit_post(res) # 复审详情 rv = audit_api.tenant_audits_results_id_company_re_audit_get(task_id) assert rv.audit_status == 'approved' assert rv.uid == uid assert rv.re_status == 'disapproved' rv = exchange_api.exchange_exchange_status_get() assert rv.status == 'disapproved'
def test_exchange_post(self, with_login): audit_api = AuditApi() user = self.data['user'] email = user['email'] password = user['password'] exchange_api = ExchangeManagementApi() e_api = ExchangeApi() ma_api = MainAccountApi() f_api = FavoriteManagementApi() token = with_login('tenant', [exchange_api, e_api, f_api, ma_api], email, password) id_number = get_random_id_number() individual_verify('tenant', id_number, token) e = Exchange(exchange_api, token) exchange = e.get_exchange() exchange_api.exchange_post(exchange) rv = exchange_api.exchange_exchange_status_get() assert rv.status == 'pending' admin_token = get_admin_token() set_login_status(audit_api, admin_token) # 初审 uid = self.data['account_id'] rv = audit_api.tenant_audits_get(uid=uid, exchange_name=exchange.name, type='audit') task = rv.items[0] task_id = task.id res = PostTenantAuditRequest(id=task_id, is_data_received=True, status='approved') audit_api.tenant_audits_audit_post(res) # 初审详情 rv = audit_api.tenant_audits_results_id_company_audit_get(task_id) assert rv.audit_status == 'approved' assert rv.uid == uid # 复审 res = PostTenantReAuditRequest(id=task_id, status='approved') audit_api.tenant_audits_re_audit_post(res) # 复审详情 rv = audit_api.tenant_audits_results_id_company_re_audit_get(task_id) assert rv.audit_status == 'approved' assert rv.uid == uid assert rv.re_status == 'approved' rv = exchange_api.exchange_exchange_status_get() assert rv.status == 'approved' # 合并测试用例 """2.新增交易所——交易所列表模糊查询——收藏——收藏列表(交易所)""" # res = PostPlatFormRegisterRequest() # ma_api.create_platform(body=res) rv = e_api.exchanges_suggestion_get(name=exchange.name) assert len(rv) >= 1 exchange_id = rv[0]['id'] # 收藏 req = PostFavoriterRequest() req.favorite_id = exchange_id req.type = 'exchange' f_api.favorites_post(req) # 收藏列表 rv = f_api.favorites_get(type='exchange') items = rv.items assert len(items) == 1 item = items[0] assert item.favorite_id == exchange_id favorite_record_id = item.id """6.收藏交易所成功——收藏列表(交易所)——取消收藏""" # 取消收藏 f_api.favorites_delete(favorite_record_id) rv = f_api.favorites_is_favorite_get(favorite_id=exchange_id, type='exchange') assert not rv.status