summaryrefslogtreecommitdiffstats
path: root/tests/functional/purge_users.py
blob: 713ea46348562d6e12f1105a40e8e74ce936a58d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import pykolab

from pykolab import wap_client
from pykolab.auth import Auth
from pykolab.imap import IMAP

conf = pykolab.getConf()


def purge_users():
    wap_client.authenticate(conf.get("ldap", "bind_dn"), conf.get("ldap", "bind_pw"))

    users = wap_client.users_list()
    for user in users['list']:
        wap_client.user_delete({'id': user})

    from tests.functional.purge_imap import purge_imap
    purge_imap()