Changeset - 605707b50d7c
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 14 years ago 2011-09-22 02:06:08
marcin@python-works.com
test fixes for vcs update
3 files changed with 26 insertions and 7 deletions:
0 comments (0 inline, 0 general)
rhodecode/tests/functional/test_admin_ldap_settings.py
Show inline comments
 
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("""<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)
 

	
rhodecode/tests/functional/test_home.py
Show inline comments
 
@@ -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 """<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 &lt;marcin@python-works.com&gt;
 
merge" class="tooltip" href="/vcs_test_hg/changeset/27cd5cce30c96924232dffcd24178a07ffeb5dfc">r173:27cd5cce30c9</a>"""
 
                            in response.body)
rhodecode/tests/functional/test_login.py
Show inline comments
 
@@ -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'
0 comments (0 inline, 0 general)