diff --git a/rhodecode/tests/functional/test_repos.py b/rhodecode/tests/functional/test_repos.py --- a/rhodecode/tests/functional/test_repos.py +++ b/rhodecode/tests/functional/test_repos.py @@ -1,8 +1,10 @@ +from rhodecode.model.db import Repository from rhodecode.tests import * class TestReposController(TestController): def test_index(self): + self.log_user() response = self.app.get(url('repos')) # Test response... @@ -10,9 +12,35 @@ class TestReposController(TestController response = self.app.get(url('formatted_repos', format='xml')) def test_create(self): - response = self.app.post(url('repos')) + self.log_user() + repo_name = 'vcs_test_new' + description = 'description for newly created repo' + private = False + response = self.app.post(url('repos'), {'repo_name':repo_name, + 'description':description, + 'private':private}) + + print response + + #test if we have a message that fork is ok + assert '''created repository %s''' % (repo_name) in response.session['flash'][0], 'No flash message about new repo' + + #test if the fork was created in the database + new_repo = self.sa.query(Repository).filter(Repository.repo_name == repo_name).one() + + assert new_repo.repo_name == repo_name, 'wrong name of repo name in db' + assert new_repo.description == description, 'wrong description' + + #test if repository is visible in the list ? + response = response.follow() + + assert repo_name in response.body, 'missing new repo from the main repos list' + + + def test_new(self): + self.log_user() response = self.app.get(url('new_repo')) def test_new_as_xml(self): @@ -31,6 +59,7 @@ class TestReposController(TestController response = self.app.post(url('repo', repo_name='vcs_test'), params=dict(_method='delete')) def test_show(self): + self.log_user() response = self.app.get(url('repo', repo_name='vcs_test')) def test_show_as_xml(self):