def setUpClass(cls): fixture.setup_login_admin(cls) fixture.setup_login(cls) fixture.setup_login_invest_user(cls) fixture.setup_add(cls) aduit_url = handle_conf.Conf.get("env", "url") + "/loan/audit" headers = eval(handle_conf.Conf.get("env", "headers")) headers["Authorization"] = cls.admin_token params = {"loan_id": cls.loan_id, "approved_or_not": True} response = requests.patch(url=aduit_url, headers=headers, json=params)
def setUpClass(cls): """投资接口的前置条件""" # 1、登录(三个用户) # 管理员 fixture.setup_login_admin(cls) # 借款人 fixture.setup_login(cls) # 投资人 fixture.setup_login_invest(cls) # 2、添加项目(借款人) """添加项目,提取项目id""" fixture.setup_add(cls) # 3、审核项目(管理员) aduit_url = conf.get("env", "base_url") + "/loan/audit" params = {"loan_id": cls.loan_id, "approved_or_not": True} headers = eval(conf.get("env", "headers")) headers["Authorization"] = cls.admin_token response = requests.request(url=aduit_url, method="patch", json=params, headers=headers)
def setUpClass(cls): """审核项目的前置:管理员和普通用户登录""" # ----------------普通用户登录---------------- fixture.setup_login(cls) # ----------------管理员用户登录--------------- fixture.setup_login_admin(cls)
def setUpClass(cls): """写该用例类执行之前的前置 登录,获取token,和用户id """ fixture.setup_login(cls)
def setUpClass(cls): fixture.setup_login(cls) fixture.setup_login_admin(cls)