Commit 26af2668 by fanxun

SSO登录添加conftest

parent 1dd28fd4
__author__ = 'fanxun'
__data__ = "2021-05-08 10:26"
import pytest
from config import BaseConfig
from common.utils.encryption import Encryption
from common.tools import request_main
@pytest.fixture(scope='module', autouse=True)
def sso_login():
"""SSO登录获取token"""
encrypted_password = Encryption().get_md5(BaseConfig.sso_password, salt=BaseConfig.salt)
req_data = {"loginName": BaseConfig.sso_username, "password": encrypted_password}
res = request_main(BaseConfig.sso_url, headers=None, method='post', data=req_data)
setattr(BaseConfig, BaseConfig.sso_token, res['data']['token'])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment