Show More
@@ -1,47 +1,47 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 | response = self.app.get(url(controller='summary', |
|
10 | response = self.app.get(url(controller='summary', | |
11 | action='index', repo_name=HG_REPO)) |
|
11 | action='index', repo_name=HG_REPO)) | |
12 |
|
12 | |||
13 | #repo type |
|
13 | #repo type | |
14 | self.assertTrue("""<img style="margin-bottom:2px" class="icon" """ |
|
14 | self.assertTrue("""<img style="margin-bottom:2px" class="icon" """ | |
15 | """title="Mercurial repository" alt="Mercurial """ |
|
15 | """title="Mercurial repository" alt="Mercurial """ | |
16 | """repository" src="/images/icons/hgicon.png"/>""" |
|
16 | """repository" src="/images/icons/hgicon.png"/>""" | |
17 | in response.body) |
|
17 | in response.body) | |
18 | self.assertTrue("""<img style="margin-bottom:2px" class="icon" """ |
|
18 | self.assertTrue("""<img style="margin-bottom:2px" class="icon" """ | |
19 | """title="public repository" alt="public """ |
|
19 | """title="public repository" alt="public """ | |
20 | """repository" src="/images/icons/lock_open.png"/>""" |
|
20 | """repository" src="/images/icons/lock_open.png"/>""" | |
21 | in response.body) |
|
21 | in response.body) | |
22 |
|
22 | |||
23 | #codes stats |
|
23 | #codes stats | |
24 | self._enable_stats() |
|
24 | self._enable_stats() | |
25 |
|
25 | |||
26 | invalidate_cache('get_repo_cached_%s' % HG_REPO) |
|
26 | invalidate_cache('get_repo_cached_%s' % HG_REPO) | |
27 | response = self.app.get(url(controller='summary', action='index', |
|
27 | response = self.app.get(url(controller='summary', action='index', | |
28 | repo_name=HG_REPO)) |
|
28 | repo_name=HG_REPO)) | |
29 |
|
29 | |||
30 | response.mustcontain( |
|
30 | response.mustcontain( | |
31 |
"""var data = |
|
31 | """var data = [["py", {"count": 42, "desc": ["Python"]}], """ | |
32 |
"""[" |
|
32 | """["rst", {"count": 11, "desc": ["Rst"]}], """ | |
33 |
"""[" |
|
33 | """["sh", {"count": 2, "desc": ["Bash"]}], """ | |
34 |
""""makefile" |
|
34 | """["makefile", {"count": 1, "desc": ["Makefile", "Makefile"]}],""" | |
35 |
""" |
|
35 | """ ["cfg", {"count": 1, "desc": ["Ini"]}], """ | |
36 |
""" |
|
36 | """["css", {"count": 1, "desc": ["Css"]}], """ | |
37 |
"""{"count": 1, "desc": ["Batch"]} |
|
37 | """["bat", {"count": 1, "desc": ["Batch"]}]];""" | |
38 | ) |
|
38 | ) | |
39 |
|
39 | |||
40 | # clone url... |
|
40 | # clone url... | |
41 | response.mustcontain("""<input type="text" id="clone_url" readonly="readonly" value="hg clone http://test_admin@localhost:80/%s" size="70"/>""" % HG_REPO) |
|
41 | response.mustcontain("""<input type="text" id="clone_url" readonly="readonly" value="hg clone http://test_admin@localhost:80/%s" size="70"/>""" % HG_REPO) | |
42 |
|
42 | |||
43 | def _enable_stats(self): |
|
43 | def _enable_stats(self): | |
44 | r = Repository.get_by_repo_name(HG_REPO) |
|
44 | r = Repository.get_by_repo_name(HG_REPO) | |
45 | r.enable_statistics = True |
|
45 | r.enable_statistics = True | |
46 | self.sa.add(r) |
|
46 | self.sa.add(r) | |
47 | self.sa.commit() |
|
47 | self.sa.commit() |
General Comments 0
You need to be logged in to leave comments.
Login now