Mercurial > kallithea
annotate rhodecode/tests/functional/test_settings.py @ 1506:7865043e4ca9 beta
fixed broken check_repo on middlewares
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 01 Oct 2011 21:40:34 +0300 |
parents | 6832ef664673 |
children | 54687aa00724 |
rev | line source |
---|---|
547
1e757ac98988
renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
535
diff
changeset
|
1 from rhodecode.model.db import Repository |
1e757ac98988
renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
535
diff
changeset
|
2 from rhodecode.tests import * |
320
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
3 |
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
4 class TestSettingsController(TestController): |
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
5 |
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
6 def test_index(self): |
473
6b934c9607e7
Improved testing scenarios. Made test env creator
Marcin Kuzminski <marcin@python-works.com>
parents:
459
diff
changeset
|
7 self.log_user() |
459
7c978511c951
implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
8 response = self.app.get(url(controller='settings', action='index', |
688
8acbfa837180
Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents:
567
diff
changeset
|
9 repo_name=HG_REPO)) |
320
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
10 # Test response... |
688
8acbfa837180
Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents:
567
diff
changeset
|
11 |
533
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
12 def test_fork(self): |
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
13 self.log_user() |
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
14 response = self.app.get(url(controller='settings', action='fork', |
688
8acbfa837180
Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents:
567
diff
changeset
|
15 repo_name=HG_REPO)) |
8acbfa837180
Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents:
567
diff
changeset
|
16 |
533
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
17 |
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
18 def test_fork_create(self): |
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
19 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:
567
diff
changeset
|
20 fork_name = HG_FORK |
533
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
21 description = 'fork of vcs test' |
688
8acbfa837180
Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents:
567
diff
changeset
|
22 repo_name = HG_REPO |
533
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
23 response = self.app.post(url(controller='settings', action='fork_create', |
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
24 repo_name=repo_name), |
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
25 {'fork_name':fork_name, |
688
8acbfa837180
Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents:
567
diff
changeset
|
26 'repo_type':'hg', |
533
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
27 'description':description, |
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
28 'private':'False'}) |
688
8acbfa837180
Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents:
567
diff
changeset
|
29 |
533
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
30 #test if we have a message that fork is ok |
728
f1629c0c28cc
fixed bug in forms found due to testing,
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
31 assert 'forked %s repository as %s' \ |
533
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
32 % (repo_name, fork_name) in response.session['flash'][0], 'No flash message about fork' |
688
8acbfa837180
Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents:
567
diff
changeset
|
33 |
533
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
34 #test if the fork was created in the database |
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
35 fork_repo = self.sa.query(Repository).filter(Repository.repo_name == fork_name).one() |
688
8acbfa837180
Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents:
567
diff
changeset
|
36 |
533
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
37 assert fork_repo.repo_name == fork_name, 'wrong name of repo name in new db fork repo' |
567
80dc0a23edf7
fixed whoosh failure on new repository
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
38 assert fork_repo.fork.repo_name == repo_name, 'wrong fork parrent' |
688
8acbfa837180
Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents:
567
diff
changeset
|
39 |
8acbfa837180
Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents:
567
diff
changeset
|
40 |
533
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
41 #test if fork is visible in the list ? |
534
12c976209b2e
fixed test for new version 100% test are ok
Marcin Kuzminski <marcin@python-works.com>
parents:
533
diff
changeset
|
42 response = response.follow() |
535
72778dda34cf
some fixups in cache, added fallback and cache invalidation when key not found in cached repos list,
Marcin Kuzminski <marcin@python-works.com>
parents:
534
diff
changeset
|
43 |
72778dda34cf
some fixups in cache, added fallback and cache invalidation when key not found in cached repos list,
Marcin Kuzminski <marcin@python-works.com>
parents:
534
diff
changeset
|
44 |
72778dda34cf
some fixups in cache, added fallback and cache invalidation when key not found in cached repos list,
Marcin Kuzminski <marcin@python-works.com>
parents:
534
diff
changeset
|
45 #check if fork is marked as fork |
72778dda34cf
some fixups in cache, added fallback and cache invalidation when key not found in cached repos list,
Marcin Kuzminski <marcin@python-works.com>
parents:
534
diff
changeset
|
46 response = self.app.get(url(controller='summary', action='index', |
72778dda34cf
some fixups in cache, added fallback and cache invalidation when key not found in cached repos list,
Marcin Kuzminski <marcin@python-works.com>
parents:
534
diff
changeset
|
47 repo_name=fork_name)) |
688
8acbfa837180
Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents:
567
diff
changeset
|
48 |
535
72778dda34cf
some fixups in cache, added fallback and cache invalidation when key not found in cached repos list,
Marcin Kuzminski <marcin@python-works.com>
parents:
534
diff
changeset
|
49 assert 'Fork of %s' % repo_name in response.body, 'no message about that this repo is a fork' |