##// END OF EJS Templates
Fixed #161 form saves the create repository permission....
Fixed #161 form saves the create repository permission. routing update for users to support second form posting. models updates

File last commit:

r1203:6832ef66 beta
r1266:a1bcfe58 beta
Show More
test_settings.py
49 lines | 1.9 KiB | text/x-python | PythonLexer
renamed project to rhodecode
r547 from rhodecode.model.db import Repository
from rhodecode.tests import *
class TestSettingsController(TestController):
def test_index(self):
self.log_user()
response = self.app.get(url(controller='settings', action='index',
Tests rewrite for 1.2 added some globals configs to make tests easier....
r688 repo_name=HG_REPO))
renamed project to rhodecode
r547 # Test response...
Tests rewrite for 1.2 added some globals configs to make tests easier....
r688
renamed project to rhodecode
r547 def test_fork(self):
self.log_user()
response = self.app.get(url(controller='settings', action='fork',
Tests rewrite for 1.2 added some globals configs to make tests easier....
r688 repo_name=HG_REPO))
renamed project to rhodecode
r547
def test_fork_create(self):
self.log_user()
Tests rewrite for 1.2 added some globals configs to make tests easier....
r688 fork_name = HG_FORK
renamed project to rhodecode
r547 description = 'fork of vcs test'
Tests rewrite for 1.2 added some globals configs to make tests easier....
r688 repo_name = HG_REPO
renamed project to rhodecode
r547 response = self.app.post(url(controller='settings', action='fork_create',
repo_name=repo_name),
{'fork_name':fork_name,
Tests rewrite for 1.2 added some globals configs to make tests easier....
r688 'repo_type':'hg',
renamed project to rhodecode
r547 'description':description,
'private':'False'})
Tests rewrite for 1.2 added some globals configs to make tests easier....
r688
renamed project to rhodecode
r547 #test if we have a message that fork is ok
fixed bug in forms found due to testing,...
r728 assert 'forked %s repository as %s' \
renamed project to rhodecode
r547 % (repo_name, fork_name) in response.session['flash'][0], 'No flash message about fork'
Tests rewrite for 1.2 added some globals configs to make tests easier....
r688
renamed project to rhodecode
r547 #test if the fork was created in the database
fork_repo = self.sa.query(Repository).filter(Repository.repo_name == fork_name).one()
Tests rewrite for 1.2 added some globals configs to make tests easier....
r688
renamed project to rhodecode
r547 assert fork_repo.repo_name == fork_name, 'wrong name of repo name in new db fork repo'
fixed whoosh failure on new repository...
r567 assert fork_repo.fork.repo_name == repo_name, 'wrong fork parrent'
Tests rewrite for 1.2 added some globals configs to make tests easier....
r688
renamed project to rhodecode
r547 #test if fork is visible in the list ?
response = response.follow()
#check if fork is marked as fork
response = self.app.get(url(controller='summary', action='index',
repo_name=fork_name))
Tests rewrite for 1.2 added some globals configs to make tests easier....
r688
renamed project to rhodecode
r547 assert 'Fork of %s' % repo_name in response.body, 'no message about that this repo is a fork'