Mercurial > kallithea
annotate rhodecode/tests/functional/test_home.py @ 4186:7e5f8c12a3fc kallithea-2.2.5-rebrand
First step in two-part process to rename directories to kallithea.
This first step is to change all references in the files where they refer
to the old directory name.
author | Bradley M. Kuhn <bkuhn@sfconservancy.org> |
---|---|
date | Wed, 02 Jul 2014 19:04:28 -0400 |
parents | ffd45b185016 |
children |
rev | line source |
---|---|
2714
a2eaa0054430
fixed error when disabled anonymous access lead to error on server
Marcin Kuzminski <marcin@python-works.com>
parents:
2427
diff
changeset
|
1 import time |
4186
7e5f8c12a3fc
First step in two-part process to rename directories to kallithea.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4116
diff
changeset
|
2 from kallithea.tests import * |
7e5f8c12a3fc
First step in two-part process to rename directories to kallithea.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4116
diff
changeset
|
3 from kallithea.tests.fixture import Fixture |
7e5f8c12a3fc
First step in two-part process to rename directories to kallithea.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4116
diff
changeset
|
4 from kallithea.model.meta import Session |
7e5f8c12a3fc
First step in two-part process to rename directories to kallithea.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4116
diff
changeset
|
5 from kallithea.model.db import User, Repository |
7e5f8c12a3fc
First step in two-part process to rename directories to kallithea.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4116
diff
changeset
|
6 from kallithea.model.repo import RepoModel |
7e5f8c12a3fc
First step in two-part process to rename directories to kallithea.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4116
diff
changeset
|
7 from kallithea.model.repo_group import RepoGroupModel |
462
298546182b41
more test suites on login, fixed strange detached instance bug found during in tests.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
8 |
1788 | 9 |
3647
8a86836fad64
more usage of fixture tools
Marcin Kuzminski <marcin@python-works.com>
parents:
3291
diff
changeset
|
10 fixture = Fixture() |
8a86836fad64
more usage of fixture tools
Marcin Kuzminski <marcin@python-works.com>
parents:
3291
diff
changeset
|
11 |
8a86836fad64
more usage of fixture tools
Marcin Kuzminski <marcin@python-works.com>
parents:
3291
diff
changeset
|
12 |
691
7486da5f0628
Refactor codes for scm model
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
13 class TestHomeController(TestController): |
462
298546182b41
more test suites on login, fixed strange detached instance bug found during in tests.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
14 |
298546182b41
more test suites on login, fixed strange detached instance bug found during in tests.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
15 def test_index(self): |
464
cbe777be5b8c
some more basic tests
Marcin Kuzminski <marcin@python-works.com>
parents:
462
diff
changeset
|
16 self.log_user() |
688
8acbfa837180
Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
17 response = self.app.get(url(controller='home', action='index')) |
464
cbe777be5b8c
some more basic tests
Marcin Kuzminski <marcin@python-works.com>
parents:
462
diff
changeset
|
18 #if global permission is set |
4116
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4010
diff
changeset
|
19 response.mustcontain('Add Repository') |
3752
1e5bb8ed77d6
index: always use lightweight - there shouldn't be any reason not to
Mads Kiilerich <madski@unity3d.com>
parents:
3734
diff
changeset
|
20 # html in javascript variable: |
4116
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4010
diff
changeset
|
21 response.mustcontain('var data = {"totalRecords": %s' % len(Repository.getAll())) |
3752
1e5bb8ed77d6
index: always use lightweight - there shouldn't be any reason not to
Mads Kiilerich <madski@unity3d.com>
parents:
3734
diff
changeset
|
22 response.mustcontain(r'href=\"/%s\"' % HG_REPO) |
875 | 23 |
4116
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4010
diff
changeset
|
24 response.mustcontain(r'<i class=\"icon-git\"') |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4010
diff
changeset
|
25 response.mustcontain(r'<i class=\"icon-unlock-alt\"') |
1788 | 26 |
3797
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3752
diff
changeset
|
27 response.mustcontain("""fixes issue with having custom format for git-log""") |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3752
diff
changeset
|
28 response.mustcontain("""/%s/changeset/5f2c6ee195929b0be80749243c18121c9864a3b3""" % GIT_REPO) |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3752
diff
changeset
|
29 |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3752
diff
changeset
|
30 response.mustcontain("""disable security checks on hg clone for travis""") |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3752
diff
changeset
|
31 response.mustcontain("""/%s/changeset/96507bd11ecc815ebc6270fdf6db110928c09c1e""" % HG_REPO) |
2714
a2eaa0054430
fixed error when disabled anonymous access lead to error on server
Marcin Kuzminski <marcin@python-works.com>
parents:
2427
diff
changeset
|
32 |
a2eaa0054430
fixed error when disabled anonymous access lead to error on server
Marcin Kuzminski <marcin@python-works.com>
parents:
2427
diff
changeset
|
33 def test_repo_summary_with_anonymous_access_disabled(self): |
4116
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4010
diff
changeset
|
34 with fixture.anon_access(False): |
2714
a2eaa0054430
fixed error when disabled anonymous access lead to error on server
Marcin Kuzminski <marcin@python-works.com>
parents:
2427
diff
changeset
|
35 response = self.app.get(url(controller='summary', |
a2eaa0054430
fixed error when disabled anonymous access lead to error on server
Marcin Kuzminski <marcin@python-works.com>
parents:
2427
diff
changeset
|
36 action='index', repo_name=HG_REPO), |
a2eaa0054430
fixed error when disabled anonymous access lead to error on server
Marcin Kuzminski <marcin@python-works.com>
parents:
2427
diff
changeset
|
37 status=302) |
a2eaa0054430
fixed error when disabled anonymous access lead to error on server
Marcin Kuzminski <marcin@python-works.com>
parents:
2427
diff
changeset
|
38 assert 'login' in response.location |
a2eaa0054430
fixed error when disabled anonymous access lead to error on server
Marcin Kuzminski <marcin@python-works.com>
parents:
2427
diff
changeset
|
39 |
a2eaa0054430
fixed error when disabled anonymous access lead to error on server
Marcin Kuzminski <marcin@python-works.com>
parents:
2427
diff
changeset
|
40 def test_index_with_anonymous_access_disabled(self): |
4116
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4010
diff
changeset
|
41 with fixture.anon_access(False): |
2714
a2eaa0054430
fixed error when disabled anonymous access lead to error on server
Marcin Kuzminski <marcin@python-works.com>
parents:
2427
diff
changeset
|
42 response = self.app.get(url(controller='home', action='index'), |
a2eaa0054430
fixed error when disabled anonymous access lead to error on server
Marcin Kuzminski <marcin@python-works.com>
parents:
2427
diff
changeset
|
43 status=302) |
a2eaa0054430
fixed error when disabled anonymous access lead to error on server
Marcin Kuzminski <marcin@python-works.com>
parents:
2427
diff
changeset
|
44 assert 'login' in response.location |
2946
dbb311201ce3
add test for enabling lightweight dashboard
Marcin Kuzminski <marcin@python-works.com>
parents:
2714
diff
changeset
|
45 |
3167
87258a137018
fixed issue with displaying repos in groups view (without lightweight dashboard), added tests for this case
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
46 def test_index_page_on_groups(self): |
87258a137018
fixed issue with displaying repos in groups view (without lightweight dashboard), added tests for this case
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
47 self.log_user() |
4116
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4010
diff
changeset
|
48 gr = fixture.create_repo_group('gr1') |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4010
diff
changeset
|
49 fixture.create_repo(name='gr1/repo_in_group', repo_group=gr) |
3167
87258a137018
fixed issue with displaying repos in groups view (without lightweight dashboard), added tests for this case
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
50 response = self.app.get(url('repos_group_home', group_name='gr1')) |
87258a137018
fixed issue with displaying repos in groups view (without lightweight dashboard), added tests for this case
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
51 |
87258a137018
fixed issue with displaying repos in groups view (without lightweight dashboard), added tests for this case
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
52 try: |
3647
8a86836fad64
more usage of fixture tools
Marcin Kuzminski <marcin@python-works.com>
parents:
3291
diff
changeset
|
53 response.mustcontain("gr1/repo_in_group") |
3167
87258a137018
fixed issue with displaying repos in groups view (without lightweight dashboard), added tests for this case
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
54 finally: |
87258a137018
fixed issue with displaying repos in groups view (without lightweight dashboard), added tests for this case
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
55 RepoModel().delete('gr1/repo_in_group') |
4116
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4010
diff
changeset
|
56 RepoGroupModel().delete(repo_group='gr1', force_delete=True) |
3167
87258a137018
fixed issue with displaying repos in groups view (without lightweight dashboard), added tests for this case
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
57 Session().commit() |