Esempio n. 1
0
def clean_user_groups():
    for u in user_list()["users"]:
        user_delete(u)

    for g in user_group_list()["groups"]:
        if g not in ["all_users", "visitors"]:
            user_group_delete(g)
Esempio n. 2
0
def test_del_group(mocker):

    with message(mocker, "group_deleted", group="dev"):
        user_group_delete("dev")

    group_res = user_group_list()["groups"]
    assert "dev" not in group_res
Esempio n. 3
0
def clean_user_groups_permission():
    for u in user_list()['users']:
        user_delete(u)

    for g in user_group_list()['groups']:
        if g not in ["all_users", "visitors"]:
            user_group_delete(g)

    for p in user_permission_list()['permissions']:
        if any(
                p.startswith(name) for name in
            ["wiki", "blog", "site", "web", "permissions_app"]):
            permission_delete(p, force=True, sync_perm=False)
    socket.getaddrinfo = prv_getaddrinfo
Esempio n. 4
0
def test_del_group_that_does_not_exist(mocker):
    with raiseYunohostError(mocker, "group_unknown"):
        user_group_delete("doesnt_exist")
Esempio n. 5
0
def test_del_group_all_users(mocker):
    with raiseYunohostError(mocker, "group_cannot_be_deleted"):
        user_group_delete("all_users")