annotate pylons_app/tests/functional/test_settings.py @ 534:12c976209b2e

fixed test for new version 100% test are ok
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 01 Oct 2010 02:19:34 +0200
parents 53aa1ee1af86
children 72778dda34cf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
533
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
1 from pylons_app.model.db import Repository
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
2 from pylons_app.tests import *
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',
7c978511c951 implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents: 320
diff changeset
9 repo_name='vcs_test'))
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...
533
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
11
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',
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
15 repo_name='vcs_test'))
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
16
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()
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
20 fork_name = 'vcs_test_fork'
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'
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
22 repo_name = 'vcs_test'
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,
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
26 'description':description,
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
27 'private':'False'})
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
28
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
29
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
30 print response
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
31
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
32 #test if we have a message that fork is ok
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
33 assert 'fork %s repository as %s task added' \
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
34 % (repo_name, fork_name) in response.session['flash'][0], 'No flash message about fork'
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
35
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
36 #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
37 fork_repo = self.sa.query(Repository).filter(Repository.repo_name == fork_name).one()
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
38
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
39 assert fork_repo.repo_name == fork_name, 'wrong name of repo name in new db fork repo'
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
40 assert fork_repo.fork.repo_name == repo_name, 'wron fork parrent'
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
41
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
42
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
43 #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
44 response = response.follow()
533
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
45
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
46 print response