summaryrefslogtreecommitdiffstats
path: root/tests/functional/test_wap_client/test_006_form_value_select_options.py
blob: 92b4992c251cc701c75f950bdcd9d4c143cafece (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import time
import unittest

import pykolab
from pykolab import wap_client

conf = pykolab.getConf()

class TestFormValueListOptions(unittest.TestCase):

    def test_001_list_options_user_preferredlanguage(self):
        conf = pykolab.getConf()
        conf.finalize_conf(fatal=False)

        self.login = conf.get('ldap', 'bind_dn')
        self.password = conf.get('ldap', 'bind_pw')
        self.domain = conf.get('kolab', 'primary_domain')

        result = wap_client.authenticate(self.login, self.password, self.domain)

        attribute_values = wap_client.form_value_select_options(
                'user',
                1,
                'preferredlanguage'
            )

        self.assertTrue(attribute_values['preferredlanguage'].has_key('default'))
        self.assertTrue(attribute_values['preferredlanguage'].has_key('list'))
        self.assertTrue(len(attribute_values['preferredlanguage']['list']) > 1)
        self.assertTrue(attribute_values['preferredlanguage']['default'] in attribute_values['preferredlanguage']['list'])