Exemplo n.º 1
0
def start_session(username="******",
                  password="******",
                  enterprise="enterprise",
                  api_url="https://*****:*****@enterprse.com"
    user.enterprise_id = "<enterprise_id>"
    user.enterprise_name = "enterprise"
    user.firstname = "John",
    user.id = "<user_id>"
    user.lastname = "Doe"
    user.role = "ROLE"

    # Set API KEY
    session._login_controller.api_key = user.api_key

    with patch.object(NURESTTestSession, "_authenticate", return_value=True):
        session.start()

    return user
Exemplo n.º 2
0
def start_session(username="******", password="******", enterprise="enterprise", api_url="https://*****:*****@enterprse.com"
    user.enterprise_id ="<enterprise_id>"
    user.enterprise_name ="enterprise"
    user.firstname ="John",
    user.id ="<user_id>"
    user.lastname ="Doe"
    user.role ="ROLE"

    # Set API KEY
    session._login_controller.api_key = user.api_key

    # Activate session
    _NURESTSessionCurrentContext.session = session

    return user