Пример #1
0
def test_create_user(session_browser):
    """Test creating a user."""
    if functional.user_exists(session_browser, 'alice'):
        functional.delete_user(session_browser, 'alice')

    functional.create_user(session_browser, 'alice')
    assert functional.user_exists(session_browser, 'alice')
Пример #2
0
def test_rename_user(session_browser):
    """Test renaming a user."""
    _non_admin_user_exists(session_browser, 'alice')
    if functional.user_exists(session_browser, 'bob'):
        functional.delete_user(session_browser, 'bob')

    _rename_user(session_browser, 'alice', 'bob')
    assert not functional.user_exists(session_browser, 'alice')
    assert functional.user_exists(session_browser, 'bob')
Пример #3
0
def delete_user(session_browser, name):
    functional.delete_user(session_browser, name)
Пример #4
0
def user_does_not_exist(session_browser, name):
    if functional.user_exists(session_browser, name):
        functional.delete_user(session_browser, name)
Пример #5
0
def admin_user_exists(session_browser, name):
    if functional.user_exists(session_browser, name):
        functional.delete_user(session_browser, name)
    functional.create_user(session_browser, name, groups=['admin'])
Пример #6
0
def _non_admin_user_exists(session_browser, name):
    if functional.user_exists(session_browser, name):
        functional.delete_user(session_browser, name)
    functional.create_user(session_browser, name)
Пример #7
0
def test_delete_user(session_browser):
    """Test deleting a user."""
    _non_admin_user_exists(session_browser, 'alice')
    functional.delete_user(session_browser, 'alice')
    assert not functional.user_exists(session_browser, 'alice')
Пример #8
0
def user_in_group_exists(session_browser, name, group):
    if functional.user_exists(session_browser, name):
        functional.delete_user(session_browser, name)
    functional.create_user(session_browser, name, groups=[group])