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 @@ -1,13 +1,15 @@ import time from rhodecode.tests import * +from rhodecode.tests.fixture import Fixture from rhodecode.model.meta import Session -from rhodecode.model.db import User, RhodeCodeSetting, Repository -from rhodecode.lib.utils import set_rhodecode_config -from rhodecode.tests.models.common import _make_repo, _make_group +from rhodecode.model.db import User, Repository from rhodecode.model.repo import RepoModel from rhodecode.model.repos_group import ReposGroupModel +fixture = Fixture() + + class TestHomeController(TestController): def test_index(self): @@ -75,18 +77,19 @@ merge" class="tooltip" href="/vcs_test_h try: response = self.app.get(url(controller='home', action='index')) - response.mustcontain("""var data = {"totalRecords": %s""" % len(Repository.getAll())) + response.mustcontain("""var data = {"totalRecords": %s""" + % len(Repository.getAll())) finally: self._set_l_dash(False) def test_index_page_on_groups(self): self.log_user() - _make_repo(name='gr1/repo_in_group', repos_group=_make_group('gr1')) - Session().commit() + gr = fixture.create_group('gr1') + fixture.create_repo(name='gr1/repo_in_group', repos_group=gr) response = self.app.get(url('repos_group_home', group_name='gr1')) try: - response.mustcontain("""gr1/repo_in_group""") + response.mustcontain("gr1/repo_in_group") finally: RepoModel().delete('gr1/repo_in_group') ReposGroupModel().delete(repos_group='gr1', force_delete=True) @@ -95,8 +98,8 @@ merge" class="tooltip" href="/vcs_test_h def test_index_page_on_groups_with_lightweight_dashboard(self): self.log_user() self._set_l_dash(True) - _make_repo(name='gr1/repo_in_group', repos_group=_make_group('gr1')) - Session().commit() + fixture.create_repo(name='gr1/repo_in_group', + repos_group=fixture.create_group('gr1')) response = self.app.get(url('repos_group_home', group_name='gr1')) try: