summaryrefslogtreecommitdiffstats
path: root/tests/functional/purge_users.py
blob: 17db9d72af86f8895b0bf75c4c9e5d10dbd809e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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()