diff --git a/rhodecode/tests/functional/test_admin_ldap_settings.py b/rhodecode/tests/functional/test_admin_ldap_settings.py --- a/rhodecode/tests/functional/test_admin_ldap_settings.py +++ b/rhodecode/tests/functional/test_admin_ldap_settings.py @@ -1,10 +1,13 @@ from rhodecode.tests import * from rhodecode.model.db import RhodeCodeSettings +from nose.plugins.skip import SkipTest +skip_ldap_test = False try: import ldap except ImportError: # means that python-ldap is not installed + skip_ldap_test = True pass class TestLdapSettingsController(TestController): @@ -17,6 +20,9 @@ class TestLdapSettingsController(TestCon def test_ldap_save_settings(self): self.log_user() + if skip_ldap_test: + raise SkipTest('skipping due to missing ldap lib') + test_url = url(controller='admin/ldap_settings', action='ldap_settings') @@ -44,6 +50,9 @@ class TestLdapSettingsController(TestCon def test_ldap_error_form(self): self.log_user() + if skip_ldap_test: + raise SkipTest('skipping due to missing ldap lib') + test_url = url(controller='admin/ldap_settings', action='ldap_settings') @@ -61,10 +70,13 @@ class TestLdapSettingsController(TestCon 'ldap_attr_firstname':'', 'ldap_attr_lastname':'', 'ldap_attr_email':'' }) - + self.assertTrue("""The LDAP Login""" """ attribute of the CN must be specified""" in response.body) + + + self.assertTrue("""Please """ """enter a number""" in response.body) diff --git a/rhodecode/tests/functional/test_home.py b/rhodecode/tests/functional/test_home.py --- a/rhodecode/tests/functional/test_home.py +++ b/rhodecode/tests/functional/test_home.py @@ -6,10 +6,17 @@ class TestHomeController(TestController) self.log_user() response = self.app.get(url(controller='home', action='index')) #if global permission is set - assert 'ADD NEW REPOSITORY' in response.body, 'No Button for add new repository' - assert 'href="/%s/summary"' % HG_REPO in response.body, ' mising repository in list' + self.assertTrue('ADD NEW REPOSITORY' in response.body) + self.assertTrue('href="/%s/summary"' % HG_REPO in response.body) # Test response... - assert """Mercurial repository""" in response.body, 'wrong info about type of repositry' - assert """public repository""" in response.body, 'wrong info about repository availabilty' - assert """r173:27cd5cce30c9""" in response.body, 'no info about tooltip' + self.assertTrue("""""" in response.body) + self.assertTrue("""""" in response.body) + + self.assertTrue("""r173:27cd5cce30c9""" + in response.body) diff --git a/rhodecode/tests/functional/test_login.py b/rhodecode/tests/functional/test_login.py --- a/rhodecode/tests/functional/test_login.py +++ b/rhodecode/tests/functional/test_login.py @@ -173,7 +173,7 @@ class TestLoginController(TestController 'lastname':'test'}) self.assertEqual(response.status , '200 OK') - assert 'Password do not match' in response.body + assert 'Passwords do not match' in response.body def test_register_ok(self): username = 'test_regular4'