comparison rhodecode/tests/functional/test_forks.py @ 1375:f9559677c953 beta

added tests for forks and followers pages
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 09 Jun 2011 17:33:19 +0200
parents
children 64e91067b996
comparison
equal deleted inserted replaced
1374:a16f163200b8 1375:f9559677c953
1 from rhodecode.tests import *
2
3 from rhodecode.model.db import Repository
4
5 class TestForksController(TestController):
6
7 def test_index(self):
8 self.log_user()
9 repo_name = HG_REPO
10 response = self.app.get(url(controller='forks', action='forks',
11 repo_name=repo_name))
12
13 self.assertTrue("""There are no forks yet""" in response.body)
14
15
16 def test_index_with_fork(self):
17 self.log_user()
18
19 # create a fork
20 fork_name = HG_FORK
21 description = 'fork of vcs test'
22 repo_name = HG_REPO
23 response = self.app.post(url(controller='settings',
24 action='fork_create',
25 repo_name=repo_name),
26 {'fork_name':fork_name,
27 'repo_type':'hg',
28 'description':description,
29 'private':'False'})
30
31 response = self.app.get(url(controller='forks', action='forks',
32 repo_name=repo_name))
33
34
35 self.assertTrue("""<a href="/%s/summary">"""
36 """vcs_test_hg_fork</a>""" % fork_name
37 in response.body)
38
39 #remove this fork
40 response = self.app.delete(url('repo', repo_name=fork_name))
41