Mercurial > kallithea
comparison rhodecode/tests/functional/test_settings.py @ 688:8acbfa837180 beta
Tests rewrite for 1.2 added some globals configs to make tests easier.
Fixed search index_location to take from configuration files now
fixed git http_user_agent bug
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 14 Nov 2010 17:24:32 +0100 |
parents | 80dc0a23edf7 |
children | f1629c0c28cc |
comparison
equal
deleted
inserted
replaced
687:b9442a8b5e02 | 688:8acbfa837180 |
---|---|
4 class TestSettingsController(TestController): | 4 class TestSettingsController(TestController): |
5 | 5 |
6 def test_index(self): | 6 def test_index(self): |
7 self.log_user() | 7 self.log_user() |
8 response = self.app.get(url(controller='settings', action='index', | 8 response = self.app.get(url(controller='settings', action='index', |
9 repo_name='vcs_test')) | 9 repo_name=HG_REPO)) |
10 # Test response... | 10 # Test response... |
11 | 11 |
12 def test_fork(self): | 12 def test_fork(self): |
13 self.log_user() | 13 self.log_user() |
14 response = self.app.get(url(controller='settings', action='fork', | 14 response = self.app.get(url(controller='settings', action='fork', |
15 repo_name='vcs_test')) | 15 repo_name=HG_REPO)) |
16 | 16 |
17 | 17 |
18 def test_fork_create(self): | 18 def test_fork_create(self): |
19 self.log_user() | 19 self.log_user() |
20 fork_name = 'vcs_test_fork' | 20 fork_name = HG_FORK |
21 description = 'fork of vcs test' | 21 description = 'fork of vcs test' |
22 repo_name = 'vcs_test' | 22 repo_name = HG_REPO |
23 response = self.app.post(url(controller='settings', action='fork_create', | 23 response = self.app.post(url(controller='settings', action='fork_create', |
24 repo_name=repo_name), | 24 repo_name=repo_name), |
25 {'fork_name':fork_name, | 25 {'fork_name':fork_name, |
26 'repo_type':'hg', | |
26 'description':description, | 27 'description':description, |
27 'private':'False'}) | 28 'private':'False'}) |
28 | 29 |
29 | |
30 print response | |
31 | |
32 #test if we have a message that fork is ok | 30 #test if we have a message that fork is ok |
33 assert 'fork %s repository as %s task added' \ | 31 assert 'fork %s repository as %s task added' \ |
34 % (repo_name, fork_name) in response.session['flash'][0], 'No flash message about fork' | 32 % (repo_name, fork_name) in response.session['flash'][0], 'No flash message about fork' |
35 | 33 |
36 #test if the fork was created in the database | 34 #test if the fork was created in the database |
37 fork_repo = self.sa.query(Repository).filter(Repository.repo_name == fork_name).one() | 35 fork_repo = self.sa.query(Repository).filter(Repository.repo_name == fork_name).one() |
38 | 36 |
39 assert fork_repo.repo_name == fork_name, 'wrong name of repo name in new db fork repo' | 37 assert fork_repo.repo_name == fork_name, 'wrong name of repo name in new db fork repo' |
40 assert fork_repo.fork.repo_name == repo_name, 'wrong fork parrent' | 38 assert fork_repo.fork.repo_name == repo_name, 'wrong fork parrent' |
41 | 39 |
42 | 40 |
43 #test if fork is visible in the list ? | 41 #test if fork is visible in the list ? |
44 response = response.follow() | 42 response = response.follow() |
45 | 43 |
46 | 44 |
47 #check if fork is marked as fork | 45 #check if fork is marked as fork |
48 response = self.app.get(url(controller='summary', action='index', | 46 response = self.app.get(url(controller='summary', action='index', |
49 repo_name=fork_name)) | 47 repo_name=fork_name)) |
50 | 48 |
51 | |
52 print response | |
53 | |
54 assert 'Fork of %s' % repo_name in response.body, 'no message about that this repo is a fork' | 49 assert 'Fork of %s' % repo_name in response.body, 'no message about that this repo is a fork' |
55 | 50 |