##// END OF EJS Templates
fixed broken flash test
fixed broken flash test

File last commit:

r3646:63e49418 beta
r3673:28305020 beta
Show More
test_admin_ldap_settings.py
85 lines | 3.0 KiB | text/x-python | PythonLexer
/ rhodecode / tests / functional / test_admin_ldap_settings.py
fixes #77 moved out ldap config to it's own section
r769 from rhodecode.tests import *
refactoring of models names for repoGroup permissions
r1633 from rhodecode.model.db import RhodeCodeSetting
fixes #173, many thanks for slestak for contributing into this one.
r1425
test fixes for vcs update
r1481 skip_ldap_test = False
fixes #173, many thanks for slestak for contributing into this one.
r1425 try:
import ldap
except ImportError:
# means that python-ldap is not installed
test fixes for vcs update
r1481 skip_ldap_test = True
fixes #173, many thanks for slestak for contributing into this one.
r1425 pass
fixes #77 moved out ldap config to it's own section
r769
Cleanup leftover print statements
r3024
fixes #77 moved out ldap config to it's own section
r769 class TestLdapSettingsController(TestController):
def test_index(self):
added some fixes to LDAP form re-submition, new simples ldap-settings getter....
r1292 self.log_user()
response = self.app.get(url(controller='admin/ldap_settings',
action='index'))
Use only mustcontain for testing response body
r3646 response.mustcontain('LDAP administration')
added some fixes to LDAP form re-submition, new simples ldap-settings getter....
r1292
def test_ldap_save_settings(self):
fixes #173, many thanks for slestak for contributing into this one.
r1425 self.log_user()
test fixes for vcs update
r1481 if skip_ldap_test:
raise SkipTest('skipping due to missing ldap lib')
auto white-space removal
r1818
fixes #173, many thanks for slestak for contributing into this one.
r1425 test_url = url(controller='admin/ldap_settings',
action='ldap_settings')
response = self.app.post(url=test_url,
params={'ldap_host' : u'dc.example.com',
'ldap_port' : '999',
'ldap_tls_kind' : 'PLAIN',
'ldap_tls_reqcert' : 'NEVER',
'ldap_dn_user':'test_user',
'ldap_dn_pass':'test_pass',
'ldap_base_dn':'test_base_dn',
'ldap_filter':'test_filter',
'ldap_search_scope':'BASE',
'ldap_attr_login':'test_attr_login',
'ldap_attr_firstname':'ima',
'ldap_attr_lastname':'tester',
'ldap_attr_email':'test@example.com' })
refactoring of models names for repoGroup permissions
r1633 new_settings = RhodeCodeSetting.get_ldap_settings()
fixes #173, many thanks for slestak for contributing into this one.
r1425 self.assertEqual(new_settings['ldap_host'], u'dc.example.com',
'fail db write compare')
self.checkSessionFlash(response,
Mads Kiilerich
consistently capitalize initial letter in flash messages
r3565 'LDAP settings updated successfully')
added some fixes to LDAP form re-submition, new simples ldap-settings getter....
r1292
def test_ldap_error_form(self):
fixes #173, many thanks for slestak for contributing into this one.
r1425 self.log_user()
test fixes for vcs update
r1481 if skip_ldap_test:
raise SkipTest('skipping due to missing ldap lib')
auto white-space removal
r1818
fixes #173, many thanks for slestak for contributing into this one.
r1425 test_url = url(controller='admin/ldap_settings',
action='ldap_settings')
response = self.app.post(url=test_url,
params={'ldap_host' : '',
'ldap_port' : 'i-should-be-number',
'ldap_tls_kind' : 'PLAIN',
'ldap_tls_reqcert' : 'NEVER',
'ldap_dn_user':'',
'ldap_dn_pass':'',
'ldap_base_dn':'',
'ldap_filter':'',
'ldap_search_scope':'BASE',
'ldap_attr_login':'', # <----- missing required input
'ldap_attr_firstname':'',
'ldap_attr_lastname':'',
'ldap_attr_email':'' })
auto white-space removal
r1818
Use only mustcontain for testing response body
r3646 response.mustcontain("""<span class="error-message">The LDAP Login"""
""" attribute of the CN must be specified""")
auto white-space removal
r1818
Use only mustcontain for testing response body
r3646 response.mustcontain("""<span class="error-message">Please """
"""enter a number</span>""")
added some fixes to LDAP form re-submition, new simples ldap-settings getter....
r1292
def test_ldap_login(self):
pass
def test_ldap_login_incorrect(self):
pass