Changeset View
Changeset View
Standalone View
Standalone View
tests/functional/purge_users.py
import pykolab | import pykolab | ||||
from pykolab import wap_client | from pykolab import wap_client | ||||
from pykolab.auth import Auth | from pykolab.auth import Auth | ||||
from pykolab.imap import IMAP | from pykolab.imap import IMAP | ||||
conf = pykolab.getConf() | conf = pykolab.getConf() | ||||
def purge_users(): | def purge_users(): | ||||
wap_client.authenticate(conf.get("ldap", "bind_dn"), conf.get("ldap", "bind_pw")) | wap_client.authenticate(conf.get("ldap", "bind_dn"), conf.get("ldap", "bind_pw")) | ||||
users = wap_client.users_list() | users = wap_client.users_list() | ||||
for user in users['list']: | for user in users['list']: | ||||
wap_client.user_delete({'id': user}) | wap_client.user_delete({'id': user}) | ||||
from tests.functional.purge_imap import purge_imap | from tests.functional.purge_imap import purge_imap | ||||
purge_imap() | purge_imap() |