##// END OF EJS Templates
merged
merged

File last commit:

r535:72778dda default
r545:2e2ae0af merge default
Show More
test_settings.py
55 lines | 2.0 KiB | text/x-python | PythonLexer
updated tests for new version 6char password etc...
r533 from pylons_app.model.db import Repository
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
r320 from pylons_app.tests import *
class TestSettingsController(TestController):
def test_index(self):
Improved testing scenarios. Made test env creator...
r473 self.log_user()
implemented basic (startup) nose test suite.
r459 response = self.app.get(url(controller='settings', action='index',
repo_name='vcs_test'))
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
r320 # Test response...
updated tests for new version 6char password etc...
r533
def test_fork(self):
self.log_user()
response = self.app.get(url(controller='settings', action='fork',
repo_name='vcs_test'))
def test_fork_create(self):
self.log_user()
fork_name = 'vcs_test_fork'
description = 'fork of vcs test'
repo_name = 'vcs_test'
response = self.app.post(url(controller='settings', action='fork_create',
repo_name=repo_name),
{'fork_name':fork_name,
'description':description,
'private':'False'})
print response
#test if we have a message that fork is ok
assert 'fork %s repository as %s task added' \
% (repo_name, fork_name) in response.session['flash'][0], 'No flash message about fork'
#test if the fork was created in the database
fork_repo = self.sa.query(Repository).filter(Repository.repo_name == fork_name).one()
assert fork_repo.repo_name == fork_name, 'wrong name of repo name in new db fork repo'
assert fork_repo.fork.repo_name == repo_name, 'wron fork parrent'
#test if fork is visible in the list ?
fixed test for new version 100% test are ok
r534 response = response.follow()
some fixups in cache, added fallback and cache invalidation when key not found in cached repos list,...
r535
#check if fork is marked as fork
response = self.app.get(url(controller='summary', action='index',
repo_name=fork_name))
updated tests for new version 6char password etc...
r533
print response
some fixups in cache, added fallback and cache invalidation when key not found in cached repos list,...
r535
assert 'Fork of %s' % repo_name in response.body, 'no message about that this repo is a fork'