Changeset - 7a9a231d365d
[Not reviewed]
default
0 1 0
Mads Kiilerich - 11 years ago 2015-01-06 00:54:36
madski@unity3d.com
tests: fix logic for disabling/enabling ldap tests
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/functional/test_admin_auth_settings.py
Show inline comments
 
@@ -20,13 +20,13 @@ class TestAuthSettingsController(TestCon
 
        response = self.app.get(url(controller='admin/auth_settings',
 
                                    action='index'))
 
        response.mustcontain('Authentication Plugins')
 

	
 
    def test_ldap_save_settings(self):
 
        self.log_user()
 
        if ldap_lib_installed:
 
        if not ldap_lib_installed:
 
            raise SkipTest('skipping due to missing ldap lib')
 

	
 
        params = self._enable_plugins('kallithea.lib.auth_modules.auth_internal,kallithea.lib.auth_modules.auth_ldap')
 
        params.update({'auth_ldap_host': u'dc.example.com',
 
                       'auth_ldap_port': '999',
 
                       'auth_ldap_tls_kind': 'PLAIN',
 
@@ -50,13 +50,13 @@ class TestAuthSettingsController(TestCon
 
        new_settings = Setting.get_auth_settings()
 
        self.assertEqual(new_settings['auth_ldap_host'], u'dc.example.com',
 
                         'fail db write compare')
 

	
 
    def test_ldap_error_form_wrong_port_number(self):
 
        self.log_user()
 
        if ldap_lib_installed:
 
        if not ldap_lib_installed:
 
            raise SkipTest('skipping due to missing ldap lib')
 

	
 
        params = self._enable_plugins('kallithea.lib.auth_modules.auth_internal,kallithea.lib.auth_modules.auth_ldap')
 
        params.update({'auth_ldap_host': '',
 
                       'auth_ldap_port': 'i-should-be-number',  # bad port num
 
                       'auth_ldap_tls_kind': 'PLAIN',
 
@@ -77,13 +77,13 @@ class TestAuthSettingsController(TestCon
 

	
 
        response.mustcontain("""<span class="error-message">"""
 
                             """Please enter a number</span>""")
 

	
 
    def test_ldap_error_form(self):
 
        self.log_user()
 
        if ldap_lib_installed:
 
        if not ldap_lib_installed:
 
            raise SkipTest('skipping due to missing ldap lib')
 

	
 
        params = self._enable_plugins('kallithea.lib.auth_modules.auth_internal,kallithea.lib.auth_modules.auth_ldap')
 
        params.update({'auth_ldap_host': 'Host',
 
                       'auth_ldap_port': '123',
 
                       'auth_ldap_tls_kind': 'PLAIN',
0 comments (0 inline, 0 general)