Changeset - f81b1fded4c9
[Not reviewed]
default
0 2 0
Marcin Kuzminski - 12 years ago 2013-06-17 22:58:22
marcin@python-works.com
fixed some tests after icon change
2 files changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
rhodecode/tests/functional/test_home.py
Show inline comments
 
@@ -17,26 +17,26 @@ class TestHomeController(TestController)
 
        response = self.app.get(url(controller='home', action='index'))
 
        #if global permission is set
 
        response.mustcontain('Add repository')
 
        # html in javascript variable:
 
        response.mustcontain("""var data = {"totalRecords": %s"""
 
                             % len(Repository.getAll()))
 
        response.mustcontain(r'href=\"/%s\"' % HG_REPO)
 

	
 
        response.mustcontain(r"""<img class=\"icon\" title=\"Mercurial repository\" """
 
                        r"""alt=\"Mercurial repository\" src=\"/images/icons/hg"""
 
                        r"""icon.png\"/>""")
 
        response.mustcontain(r"""<img class=\"icon\" title=\"Public repository\" """
 
                        r"""alt=\"Public repository\" src=\"/images/icons/lock_"""
 
                        r"""open.png\"/>""")
 
                        r"""alt=\"Public repository\" src=\"/images/icons/public_"""
 
                        r"""repo.png\"/>""")
 

	
 
        response.mustcontain("""fixes issue with having custom format for git-log""")
 
        response.mustcontain("""/%s/changeset/5f2c6ee195929b0be80749243c18121c9864a3b3""" % GIT_REPO)
 

	
 
        response.mustcontain("""disable security checks on hg clone for travis""")
 
        response.mustcontain("""/%s/changeset/96507bd11ecc815ebc6270fdf6db110928c09c1e""" % HG_REPO)
 

	
 
    def test_repo_summary_with_anonymous_access_disabled(self):
 
        anon = User.get_default_user()
 
        anon.active = False
 
        Session().add(anon)
 
        Session().commit()
rhodecode/tests/functional/test_summary.py
Show inline comments
 
@@ -17,25 +17,25 @@ class TestSummaryController(TestControll
 
                                    action='index',
 
                                    repo_name=HG_REPO))
 

	
 
        #repo type
 
        response.mustcontain(
 
            """<img style="margin-bottom:2px" class="icon" """
 
            """title="Mercurial repository" alt="Mercurial repository" """
 
            """src="/images/icons/hgicon.png"/>"""
 
        )
 
        response.mustcontain(
 
            """<img style="margin-bottom:2px" class="icon" """
 
            """title="Public repository" alt="Public """
 
            """repository" src="/images/icons/lock_open.png"/>"""
 
            """repository" src="/images/icons/public_repo.png"/>"""
 
        )
 

	
 
        #codes stats
 
        self._enable_stats()
 

	
 
        ScmModel().mark_for_invalidation(HG_REPO)
 
        response = self.app.get(url(controller='summary', action='index',
 
                                    repo_name=HG_REPO))
 
        response.mustcontain(
 
            """var data = [["py", {"count": 68, "desc": ["Python"]}], """
 
            """["rst", {"count": 16, "desc": ["Rst"]}], """
 
            """["css", {"count": 2, "desc": ["Css"]}], """
 
@@ -59,45 +59,45 @@ class TestSummaryController(TestControll
 
                                    action='index',
 
                                    repo_name=GIT_REPO))
 

	
 
        #repo type
 
        response.mustcontain(
 
            """<img style="margin-bottom:2px" class="icon" """
 
            """title="Git repository" alt="Git repository" """
 
            """src="/images/icons/giticon.png"/>"""
 
        )
 
        response.mustcontain(
 
            """<img style="margin-bottom:2px" class="icon" """
 
            """title="Public repository" alt="Public """
 
            """repository" src="/images/icons/lock_open.png"/>"""
 
            """repository" src="/images/icons/public_repo.png"/>"""
 
        )
 

	
 
        # clone url...
 
        response.mustcontain('''id="clone_url" readonly="readonly" value="http://test_admin@localhost:80/%s"''' % GIT_REPO)
 
        response.mustcontain('''id="clone_url_id" readonly="readonly" value="http://test_admin@localhost:80/_%s"''' % ID)
 

	
 
    def test_index_by_id_hg(self):
 
        self.log_user()
 
        ID = Repository.get_by_repo_name(HG_REPO).repo_id
 
        response = self.app.get(url(controller='summary',
 
                                    action='index',
 
                                    repo_name='_%s' % ID))
 

	
 
        #repo type
 
        response.mustcontain("""<img style="margin-bottom:2px" class="icon" """
 
                        """title="Mercurial repository" alt="Mercurial """
 
                        """repository" src="/images/icons/hgicon.png"/>""")
 
        response.mustcontain("""<img style="margin-bottom:2px" class="icon" """
 
                        """title="Public repository" alt="Public """
 
                        """repository" src="/images/icons/lock_open.png"/>""")
 
                        """repository" src="/images/icons/public_repo.png"/>""")
 

	
 
    def test_index_by_repo_having_id_path_in_name_hg(self):
 
        self.log_user()
 
        fixture.create_repo(name='repo_1')
 
        response = self.app.get(url(controller='summary',
 
                                    action='index',
 
                                    repo_name='repo_1'))
 

	
 
        try:
 
            response.mustcontain("repo_1")
 
        finally:
 
            RepoModel().delete(Repository.get_by_repo_name('repo_1'))
 
@@ -107,19 +107,19 @@ class TestSummaryController(TestControll
 
        self.log_user()
 
        ID = Repository.get_by_repo_name(GIT_REPO).repo_id
 
        response = self.app.get(url(controller='summary',
 
                                    action='index',
 
                                    repo_name='_%s' % ID))
 

	
 
        #repo type
 
        response.mustcontain("""<img style="margin-bottom:2px" class="icon" """
 
                        """title="Git repository" alt="Git """
 
                        """repository" src="/images/icons/giticon.png"/>""")
 
        response.mustcontain("""<img style="margin-bottom:2px" class="icon" """
 
                        """title="Public repository" alt="Public """
 
                        """repository" src="/images/icons/lock_open.png"/>""")
 
                        """repository" src="/images/icons/public_repo.png"/>""")
 

	
 
    def _enable_stats(self):
 
        r = Repository.get_by_repo_name(HG_REPO)
 
        r.enable_statistics = True
 
        Session().add(r)
 
        Session().commit()
0 comments (0 inline, 0 general)