Пример #1
0
def test_user_put():
    """--> put updates object """
    global added_obj
    
    # Change a value
    added_obj.first_name = 'Tester - edited'
    # Save the change a value
    success, resp = added_obj.save_update(TEST_SESSION)
    if not success: log_response_error(resp)
    assert success
    # Read the object again
    success, resp = User.get(TEST_SESSION, added_obj.user_id)
    if not success: log_response_error(resp)
    assert success
    # Confirm the values we read match what we wrote
    assert resp.first_name == added_obj.first_name
Пример #2
0
def test_user_get():
    """--> get returns details """
    global added_obj
    assert added_obj
    
    success, resp = User.get(TEST_SESSION, added_obj.user_id)
    if not success: log_response_error(resp)
    assert success
    assert resp.username == 'testing'
    assert resp.email == '*****@*****.**'
    assert resp.first_name == 'Tester'
    assert resp.full_name == 'Tester, Unit X'
    assert resp.last_name == 'Unit'
    assert resp.phone == '+1 (919) 999-9999'
    assert resp.profiles == {"muam": {"test": "value"}}
    assert resp.create_users == False
    assert resp.create_groups == True
    assert resp.grant_privs == False