Show More
@@ -1,55 +1,64 b'' | |||||
1 | from rhodecode.tests import * |
|
1 | from rhodecode.tests import * | |
2 |
|
2 | |||
|
3 | ||||
3 | class TestChangelogController(TestController): |
|
4 | class TestChangelogController(TestController): | |
4 |
|
5 | |||
5 | def test_index_hg(self): |
|
6 | def test_index_hg(self): | |
6 | self.log_user() |
|
7 | self.log_user() | |
7 | response = self.app.get(url(controller='changelog', action='index', |
|
8 | response = self.app.get(url(controller='changelog', action='index', | |
8 | repo_name=HG_REPO)) |
|
9 | repo_name=HG_REPO)) | |
9 |
|
10 | |||
10 |
se |
|
11 | response.mustcontain("""<div id="chg_20" class="container tablerow1">""") | |
11 | in response.body) |
|
12 | response.mustcontain( | |
12 |
|
|
13 | """<input class="changeset_range" id="5e204e7583b9" """ | |
13 |
|
|
14 | """name="5e204e7583b9" type="checkbox" value="1" />""" | |
14 | in response.body) |
|
15 | ) | |
15 | self.assertTrue("""<span>commit 154: 5e204e7583b9@2010-08-09 """ |
|
16 | response.mustcontain( | |
16 | """23:18:46</span>""" in response.body) |
|
17 | """<span class="changeset_id">154:""" | |
|
18 | """<span class="changeset_hash">5e204e7583b9</span></span>""" | |||
|
19 | ) | |||
17 |
|
20 | |||
18 |
se |
|
21 | response.mustcontain("""Small update at simplevcs app""") | |
19 |
|
||||
20 |
|
22 | |||
21 | self.assertTrue("""<span id="5e204e7583b9c8e7b93a020bd036564b1e""" |
|
23 | response.mustcontain( | |
22 | """731dae" class="changed_total tooltip" """ |
|
24 | """<div id="5e204e7583b9c8e7b93a020bd036564b1e731dae" """ | |
23 | """title="Affected number of files, click to """ |
|
25 | """style="float:right;" class="changed_total tooltip" """ | |
24 | """show more details">3</span>""" in response.body) |
|
26 | """title="Affected number of files, click to show """ | |
|
27 | """more details">3</div>""" | |||
|
28 | ) | |||
25 |
|
29 | |||
26 | #pagination |
|
30 | #pagination | |
27 | response = self.app.get(url(controller='changelog', action='index', |
|
31 | response = self.app.get(url(controller='changelog', action='index', | |
28 | repo_name=HG_REPO), {'page':1}) |
|
32 | repo_name=HG_REPO), {'page':1}) | |
29 | response = self.app.get(url(controller='changelog', action='index', |
|
33 | response = self.app.get(url(controller='changelog', action='index', | |
30 | repo_name=HG_REPO), {'page':2}) |
|
34 | repo_name=HG_REPO), {'page':2}) | |
31 | response = self.app.get(url(controller='changelog', action='index', |
|
35 | response = self.app.get(url(controller='changelog', action='index', | |
32 | repo_name=HG_REPO), {'page':3}) |
|
36 | repo_name=HG_REPO), {'page':3}) | |
33 | response = self.app.get(url(controller='changelog', action='index', |
|
37 | response = self.app.get(url(controller='changelog', action='index', | |
34 | repo_name=HG_REPO), {'page':4}) |
|
38 | repo_name=HG_REPO), {'page':4}) | |
35 | response = self.app.get(url(controller='changelog', action='index', |
|
39 | response = self.app.get(url(controller='changelog', action='index', | |
36 | repo_name=HG_REPO), {'page':5}) |
|
40 | repo_name=HG_REPO), {'page':5}) | |
37 | response = self.app.get(url(controller='changelog', action='index', |
|
41 | response = self.app.get(url(controller='changelog', action='index', | |
38 | repo_name=HG_REPO), {'page':6}) |
|
42 | repo_name=HG_REPO), {'page':6}) | |
39 |
|
43 | |||
40 |
|
||||
41 | # Test response after pagination... |
|
44 | # Test response after pagination... | |
42 | self.assertTrue("""<input class="changeset_range" id="46ad32a4f974" """ |
|
45 | response.mustcontain( | |
|
46 | """<input class="changeset_range" id="46ad32a4f974" """ | |||
43 |
|
|
47 | """name="46ad32a4f974" type="checkbox" value="1" />""" | |
44 | in response.body) |
|
48 | ) | |
45 | self.assertTrue("""<span>commit 64: 46ad32a4f974@2010-04-19""" |
|
49 | response.mustcontain( | |
46 | """ 22:33:21</span>"""in response.body) |
|
50 | """<span class="changeset_id">64:""" | |
|
51 | """<span class="changeset_hash">46ad32a4f974</span></span>""" | |||
|
52 | ) | |||
47 |
|
53 | |||
48 | self.assertTrue("""<span id="46ad32a4f974e45472a898c6b0acb600320""" |
|
54 | response.mustcontain( | |
49 | """579b1" class="changed_total tooltip" """ |
|
55 | """<div id="46ad32a4f974e45472a898c6b0acb600320579b1" """ | |
50 | """title="Affected number of files, click to """ |
|
56 | """style="float:right;" class="changed_total tooltip" """ | |
51 | """show more details">21</span>"""in response.body) |
|
57 | """title="Affected number of files, click to show """ | |
52 | self.assertTrue("""<div class="message"><a href="/%s/changeset/""" |
|
58 | """more details">21</div>""" | |
|
59 | ) | |||
|
60 | ||||
|
61 | response.mustcontain("""<div class="message"><a href="/%s/changeset/""" | |||
53 | """46ad32a4f974e45472a898c6b0acb600320579b1">""" |
|
62 | """46ad32a4f974e45472a898c6b0acb600320579b1">""" | |
54 | """Merge with 2e6a2bf9356ca56df08807f4ad86d48""" |
|
63 | """Merge with 2e6a2bf9356ca56df08807f4ad86d48""" | |
55 |
"""0da72a8f4</a></div>""" % HG_REPO |
|
64 | """0da72a8f4</a></div>""" % HG_REPO) |
@@ -1,62 +1,66 b'' | |||||
1 | from rhodecode.tests import * |
|
1 | from rhodecode.tests import * | |
2 | from rhodecode.model.db import Repository |
|
2 | from rhodecode.model.db import Repository | |
3 | from rhodecode.lib.utils import invalidate_cache |
|
3 | from rhodecode.lib.utils import invalidate_cache | |
4 |
|
4 | |||
5 |
|
5 | |||
6 | class TestSummaryController(TestController): |
|
6 | class TestSummaryController(TestController): | |
7 |
|
7 | |||
8 | def test_index(self): |
|
8 | def test_index(self): | |
9 | self.log_user() |
|
9 | self.log_user() | |
10 | ID = Repository.get_by_repo_name(HG_REPO).repo_id |
|
10 | ID = Repository.get_by_repo_name(HG_REPO).repo_id | |
11 | response = self.app.get(url(controller='summary', |
|
11 | response = self.app.get(url(controller='summary', | |
12 | action='index', |
|
12 | action='index', | |
13 | repo_name=HG_REPO)) |
|
13 | repo_name=HG_REPO)) | |
14 |
|
14 | |||
15 | #repo type |
|
15 | #repo type | |
16 | response.mustcontain("""<img style="margin-bottom:2px" class="icon" """ |
|
16 | response.mustcontain( | |
|
17 | """<img style="margin-bottom:2px" class="icon" """ | |||
17 |
|
|
18 | """title="Mercurial repository" alt="Mercurial """ | |
18 |
|
|
19 | """repository" src="/images/icons/hgicon.png"/>""" | |
19 | response.mustcontain("""<img style="margin-bottom:2px" class="icon" """ |
|
20 | ) | |
|
21 | response.mustcontain( | |||
|
22 | """<img style="margin-bottom:2px" class="icon" """ | |||
20 |
|
|
23 | """title="public repository" alt="public """ | |
21 |
|
|
24 | """repository" src="/images/icons/lock_open.png"/>""" | |
|
25 | ) | |||
22 |
|
26 | |||
23 | #codes stats |
|
27 | #codes stats | |
24 | self._enable_stats() |
|
28 | self._enable_stats() | |
25 |
|
29 | |||
26 | invalidate_cache('get_repo_cached_%s' % HG_REPO) |
|
30 | invalidate_cache('get_repo_cached_%s' % HG_REPO) | |
27 | response = self.app.get(url(controller='summary', action='index', |
|
31 | response = self.app.get(url(controller='summary', action='index', | |
28 | repo_name=HG_REPO)) |
|
32 | repo_name=HG_REPO)) | |
29 |
|
33 | response.mustcontain( | ||
30 |
|
|
34 | """var data = [["py", {"count": 42, "desc": ["Python"]}], """ | |
31 |
|
|
35 | """["rst", {"count": 11, "desc": ["Rst"]}], """ | |
32 |
|
|
36 | """["sh", {"count": 2, "desc": ["Bash"]}], """ | |
33 |
|
|
37 | """["makefile", {"count": 1, "desc": ["Makefile", "Makefile"]}],""" | |
34 |
|
|
38 | """ ["cfg", {"count": 1, "desc": ["Ini"]}], """ | |
35 |
|
|
39 | """["css", {"count": 1, "desc": ["Css"]}], """ | |
36 |
|
|
40 | """["bat", {"count": 1, "desc": ["Batch"]}]];""" | |
37 | in response.body) |
|
41 | ) | |
38 |
|
42 | |||
39 | # clone url... |
|
43 | # clone url... | |
40 | response.mustcontain("""<input style="width:80%;margin-left:105px" type="text" id="clone_url" readonly="readonly" value="http://test_admin@localhost:80/vcs_test_hg"/>""") |
|
44 | response.mustcontain("""<input style="width:80%;margin-left:105px" type="text" id="clone_url" readonly="readonly" value="http://test_admin@localhost:80/vcs_test_hg"/>""") | |
41 | response.mustcontain("""<input style="display:none;width:80%;margin-left:105px" type="text" id="clone_url_id" readonly="readonly" value="http://test_admin@localhost:80/_1"/>""") |
|
45 | response.mustcontain("""<input style="display:none;width:80%;margin-left:105px" type="text" id="clone_url_id" readonly="readonly" value="http://test_admin@localhost:80/_1"/>""") | |
42 |
|
46 | |||
43 | def test_index_by_id(self): |
|
47 | def test_index_by_id(self): | |
44 | self.log_user() |
|
48 | self.log_user() | |
45 | ID = Repository.get_by_repo_name(HG_REPO).repo_id |
|
49 | ID = Repository.get_by_repo_name(HG_REPO).repo_id | |
46 | response = self.app.get(url(controller='summary', |
|
50 | response = self.app.get(url(controller='summary', | |
47 | action='index', |
|
51 | action='index', | |
48 | repo_name='_%s' % ID)) |
|
52 | repo_name='_%s' % ID)) | |
49 |
|
53 | |||
50 | #repo type |
|
54 | #repo type | |
51 | response.mustcontain("""<img style="margin-bottom:2px" class="icon" """ |
|
55 | response.mustcontain("""<img style="margin-bottom:2px" class="icon" """ | |
52 | """title="Mercurial repository" alt="Mercurial """ |
|
56 | """title="Mercurial repository" alt="Mercurial """ | |
53 | """repository" src="/images/icons/hgicon.png"/>""") |
|
57 | """repository" src="/images/icons/hgicon.png"/>""") | |
54 | response.mustcontain("""<img style="margin-bottom:2px" class="icon" """ |
|
58 | response.mustcontain("""<img style="margin-bottom:2px" class="icon" """ | |
55 | """title="public repository" alt="public """ |
|
59 | """title="public repository" alt="public """ | |
56 | """repository" src="/images/icons/lock_open.png"/>""") |
|
60 | """repository" src="/images/icons/lock_open.png"/>""") | |
57 |
|
61 | |||
58 | def _enable_stats(self): |
|
62 | def _enable_stats(self): | |
59 | r = Repository.get_by_repo_name(HG_REPO) |
|
63 | r = Repository.get_by_repo_name(HG_REPO) | |
60 | r.enable_statistics = True |
|
64 | r.enable_statistics = True | |
61 | self.Session.add(r) |
|
65 | self.Session.add(r) | |
62 | self.Session.commit() |
|
66 | self.Session.commit() |
General Comments 0
You need to be logged in to leave comments.
Login now