summaryrefslogtreecommitdiffstats
path: root/tests/functional/test_wap_client/test_005_user_add_de_CH.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/test_wap_client/test_005_user_add_de_CH.py')
-rw-r--r--tests/functional/test_wap_client/test_005_user_add_de_CH.py57
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/functional/test_wap_client/test_005_user_add_de_CH.py b/tests/functional/test_wap_client/test_005_user_add_de_CH.py
new file mode 100644
index 0000000..dd38383
--- /dev/null
+++ b/tests/functional/test_wap_client/test_005_user_add_de_CH.py
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*-
+
+import time
+import unittest
+
+import pykolab
+from pykolab import wap_client
+from pykolab.auth import Auth
+from pykolab.imap import IMAP
+
+conf = pykolab.getConf()
+
+class TestUserAddDeCH(unittest.TestCase):
+ @classmethod
+ def setup_class(self, *args, **kw):
+ from tests.functional.purge_users import purge_users
+ purge_users()
+
+ self.user = {
+ 'local': 'thomas.bruederli',
+ 'domain': 'example.org'
+ }
+
+ from tests.functional.user_add import user_add
+ user_add("Thomas", "BrĂ¼derli", 'de_CH')
+ from tests.functional.synchronize import synchronize_once
+ synchronize_once()
+
+ @classmethod
+ def teardown_class(self, *args, **kw):
+ from tests.functional.purge_users import purge_users
+ purge_users()
+
+ def test_001_inbox_created(self):
+
+ time.sleep(2)
+ imap = IMAP()
+ imap.connect()
+
+ folders = imap.lm('user/%(local)s@%(domain)s' % (self.user))
+ self.assertEqual(len(folders), 1)
+
+ def test_002_fr_FR_user_recipient_policy(self):
+ auth = Auth()
+ auth.connect()
+ recipient = auth.find_recipient("%(local)s@%(domain)s" % (self.user))
+ if hasattr(self, 'assertIsInstance'):
+ self.assertIsInstance(recipient, str)
+
+ self.assertEqual(recipient, "uid=bruederli,ou=People,dc=example,dc=org")
+
+ result = wap_client.user_info(recipient)
+
+ self.assertEqual(result['mail'], 'thomas.bruederli@example.org')
+ self.assertEqual(sorted(result['alias']), ['bruederli@example.org', 't.bruederli@example.org'])
+
+