Mercurial > kallithea
changeset 1481:605707b50d7c beta
test fixes for vcs update
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 22 Sep 2011 03:06:08 +0300 |
parents | daa29da0f783 |
children | a39c0e5fca89 |
files | rhodecode/tests/functional/test_admin_ldap_settings.py rhodecode/tests/functional/test_home.py rhodecode/tests/functional/test_login.py |
diffstat | 3 files changed, 26 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/tests/functional/test_admin_ldap_settings.py Thu Sep 22 02:46:36 2011 +0300 +++ b/rhodecode/tests/functional/test_admin_ldap_settings.py Thu Sep 22 03:06:08 2011 +0300 @@ -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 @@ 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 @@ 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 @@ 'ldap_attr_firstname':'', 'ldap_attr_lastname':'', 'ldap_attr_email':'' }) - + self.assertTrue("""<span class="error-message">The LDAP Login""" """ attribute of the CN must be specified""" in response.body) + + + self.assertTrue("""<span class="error-message">Please """ """enter a number</span>""" in response.body)
--- a/rhodecode/tests/functional/test_home.py Thu Sep 22 02:46:36 2011 +0300 +++ b/rhodecode/tests/functional/test_home.py Thu Sep 22 03:06:08 2011 +0300 @@ -6,10 +6,17 @@ 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 """<img class="icon" title="Mercurial repository" alt="Mercurial repository" src="/images/icons/hgicon.png"/>""" in response.body, 'wrong info about type of repositry' - assert """<img class="icon" title="public repository" alt="public repository" src="/images/icons/lock_open.png"/>""" in response.body, 'wrong info about repository availabilty' - assert """<a class="tooltip" href="/vcs_test_hg/changeset/27cd5cce30c96924232dffcd24178a07ffeb5dfc" title="merge">r173:27cd5cce30c9</a>""" in response.body, 'no info about tooltip' + self.assertTrue("""<img class="icon" title="Mercurial repository" """ + """alt="Mercurial repository" src="/images/icons/hg""" + """icon.png"/>""" in response.body) + self.assertTrue("""<img class="icon" title="public repository" """ + """alt="public repository" src="/images/icons/lock_""" + """open.png"/>""" in response.body) + + self.assertTrue("""<a title="Marcin Kuzminski <marcin@python-works.com> +merge" class="tooltip" href="/vcs_test_hg/changeset/27cd5cce30c96924232dffcd24178a07ffeb5dfc">r173:27cd5cce30c9</a>""" + in response.body)
--- a/rhodecode/tests/functional/test_login.py Thu Sep 22 02:46:36 2011 +0300 +++ b/rhodecode/tests/functional/test_login.py Thu Sep 22 03:06:08 2011 +0300 @@ -173,7 +173,7 @@ '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'