annotate rhodecode/tests/functional/test_home.py @ 4116:ffd45b185016 rhodecode-2.2.5-gpl

Imported some of the GPLv3'd changes from RhodeCode v2.2.5. This imports changes between changesets 21af6c4eab3d and 6177597791c2 in RhodeCode's original repository, including only changes to Python files and HTML. RhodeCode clearly licensed its changes to these files under GPLv3 in their /LICENSE file, which states the following: The Python code and integrated HTML are licensed under the GPLv3 license. (See: https://code.rhodecode.com/rhodecode/files/v2.2.5/LICENSE or http://web.archive.org/web/20140512193334/https://code.rhodecode.com/rhodecode/files/f3b123159901f15426d18e3dc395e8369f70ebe0/LICENSE for an online copy of that LICENSE file) Conservancy reviewed these changes and confirmed that they can be licensed as a whole to the Kallithea project under GPLv3-only. While some of the contents committed herein are clearly licensed GPLv3-or-later, on the whole we must assume the are GPLv3-only, since the statement above from RhodeCode indicates that they intend GPLv3-only as their license, per GPLv3ยง14 and other relevant sections of GPLv3.
author Bradley M. Kuhn <bkuhn@sfconservancy.org>
date Wed, 02 Jul 2014 19:03:13 -0400
parents f81b1fded4c9
children 7e5f8c12a3fc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
547
1e757ac98988 renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents: 464
diff changeset
2 from rhodecode.tests import *
3647
8a86836fad64 more usage of fixture tools
Marcin Kuzminski <marcin@python-works.com>
parents: 3291
diff changeset
3 from rhodecode.tests.fixture import Fixture
2714
a2eaa0054430 fixed error when disabled anonymous access lead to error on server
Marcin Kuzminski <marcin@python-works.com>
parents: 2427
diff changeset
4 from rhodecode.model.meta import Session
3647
8a86836fad64 more usage of fixture tools
Marcin Kuzminski <marcin@python-works.com>
parents: 3291
diff changeset
5 from rhodecode.model.db import User, Repository
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
6 from rhodecode.model.repo import RepoModel
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4010
diff changeset
7 from rhodecode.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
ef0613584ced test fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1481
diff changeset
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
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 691
diff changeset
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
ef0613584ced test fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1481
diff changeset
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()