Files
@ 531ab818cc3d
Branch filter:
Location: kallithea/rhodecode/tests/functional/test_admin_auth_settings.py
531ab818cc3d
4.9 KiB
text/x-python
Add javascript for Object Code excanvas (flot) version herein included and use that instead of minified version.
I had a bit of trouble finding the upstream on excanvas, as the version from
Google, which appears to be the original source, seems unmaintained.
However, it appears the version we're carrying in Kallithea is indeed from
the excanvas era of flot.
$ (cd /tmp; \
svn -r 135 checkout http://flot.googlecode.com/svn/trunk/ flot )
$ cp /tmp/flot/excanvas.js rhodecode/public/js/excanvas.js
I also verified the sha256sum of the min file matched ours:
$ sha256sum /tmp/flot/excanvas.min.js rhodecode/public/js/excanvas.min.js
5f94b032a110504b7b261eaf71392fa3e8d82cdc6455c0cba5c9f03cd34ed122 /tmp/flot/excanvas.min.js
5f94b032a110504b7b261eaf71392fa3e8d82cdc6455c0cba5c9f03cd34ed122 rhodecode/public/js/excanvas.min.js
I had a bit of trouble finding the upstream on excanvas, as the version from
Google, which appears to be the original source, seems unmaintained.
However, it appears the version we're carrying in Kallithea is indeed from
the excanvas era of flot.
$ (cd /tmp; \
svn -r 135 checkout http://flot.googlecode.com/svn/trunk/ flot )
$ cp /tmp/flot/excanvas.js rhodecode/public/js/excanvas.js
I also verified the sha256sum of the min file matched ours:
$ sha256sum /tmp/flot/excanvas.min.js rhodecode/public/js/excanvas.min.js
5f94b032a110504b7b261eaf71392fa3e8d82cdc6455c0cba5c9f03cd34ed122 /tmp/flot/excanvas.min.js
5f94b032a110504b7b261eaf71392fa3e8d82cdc6455c0cba5c9f03cd34ed122 rhodecode/public/js/excanvas.min.js
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | from rhodecode.tests import *
from rhodecode.model.db import RhodeCodeSetting
class TestAuthSettingsController(TestController):
def _enable_plugins(self, plugins_list):
test_url = url(controller='admin/auth_settings',
action='auth_settings')
params={'auth_plugins': plugins_list,}
for plugin in plugins_list.split(','):
enable = plugin.partition('rhodecode.lib.auth_modules.')[-1]
params.update({'%s_enabled' % enable: True})
response = self.app.post(url=test_url, params=params)
return params
#self.checkSessionFlash(response, 'Auth settings updated successfully')
def test_index(self):
self.log_user()
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:
raise SkipTest('skipping due to missing ldap lib')
params = self._enable_plugins('rhodecode.lib.auth_modules.auth_rhodecode,rhodecode.lib.auth_modules.auth_ldap')
params.update({'auth_ldap_host': u'dc.example.com',
'auth_ldap_port': '999',
'auth_ldap_tls_kind': 'PLAIN',
'auth_ldap_tls_reqcert': 'NEVER',
'auth_ldap_dn_user': 'test_user',
'auth_ldap_dn_pass': 'test_pass',
'auth_ldap_base_dn': 'test_base_dn',
'auth_ldap_filter': 'test_filter',
'auth_ldap_search_scope': 'BASE',
'auth_ldap_attr_login': 'test_attr_login',
'auth_ldap_attr_firstname': 'ima',
'auth_ldap_attr_lastname': 'tester',
'auth_ldap_attr_email': 'test@example.com'})
test_url = url(controller='admin/auth_settings',
action='auth_settings')
response = self.app.post(url=test_url, params=params)
self.checkSessionFlash(response, 'Auth settings updated successfully')
new_settings = RhodeCodeSetting.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:
raise SkipTest('skipping due to missing ldap lib')
params = self._enable_plugins('rhodecode.lib.auth_modules.auth_rhodecode,rhodecode.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',
'auth_ldap_tls_reqcert': 'NEVER',
'auth_ldap_dn_user': '',
'auth_ldap_dn_pass': '',
'auth_ldap_base_dn': '',
'auth_ldap_filter': '',
'auth_ldap_search_scope': 'BASE',
'auth_ldap_attr_login': '',
'auth_ldap_attr_firstname': '',
'auth_ldap_attr_lastname': '',
'auth_ldap_attr_email': ''})
test_url = url(controller='admin/auth_settings',
action='auth_settings')
response = self.app.post(url=test_url, params=params)
response.mustcontain("""<span class="error-message">"""
"""Please enter a number</span>""")
def test_ldap_error_form(self):
self.log_user()
if ldap_lib_installed:
raise SkipTest('skipping due to missing ldap lib')
params = self._enable_plugins('rhodecode.lib.auth_modules.auth_rhodecode,rhodecode.lib.auth_modules.auth_ldap')
params.update({'auth_ldap_host': 'Host',
'auth_ldap_port': '123',
'auth_ldap_tls_kind': 'PLAIN',
'auth_ldap_tls_reqcert': 'NEVER',
'auth_ldap_dn_user': '',
'auth_ldap_dn_pass': '',
'auth_ldap_base_dn': '',
'auth_ldap_filter': '',
'auth_ldap_search_scope': 'BASE',
'auth_ldap_attr_login': '', # <----- missing required input
'auth_ldap_attr_firstname': '',
'auth_ldap_attr_lastname': '',
'auth_ldap_attr_email': ''})
test_url = url(controller='admin/auth_settings',
action='auth_settings')
response = self.app.post(url=test_url, params=params)
response.mustcontain("""<span class="error-message">The LDAP Login"""
""" attribute of the CN must be specified""")
def test_ldap_login(self):
pass
def test_ldap_login_incorrect(self):
pass
|