Show More
@@ -1,4 +1,6 b'' | |||
|
1 | 1 | from rhodecode.tests import * |
|
2 | from rhodecode.model.db import Repository | |
|
3 | from rhodecode.lib.utils import invalidate_cache | |
|
2 | 4 | |
|
3 | 5 | class TestSummaryController(TestController): |
|
4 | 6 | |
@@ -11,9 +13,20 b' class TestSummaryController(TestControll' | |||
|
11 | 13 | assert """<img style="margin-bottom:2px" class="icon" title="public repository" alt="public repository" src="/images/icons/lock_open.png"/>""" in response.body |
|
12 | 14 | |
|
13 | 15 | #codes stats |
|
16 | ||
|
17 | ||
|
18 | self._enable_stats() | |
|
19 | invalidate_cache('get_repo_cached_%s' % HG_REPO) | |
|
20 | response = self.app.get(url(controller='summary', action='index', repo_name=HG_REPO)) | |
|
14 | 21 | assert """var data = {"Python": 42, "Rst": 11, "Bash": 2, "Makefile": 1, "Batch": 1, "Ini": 1, "Css": 1};""" in response.body, 'wrong info about % of codes stats' |
|
15 | 22 | |
|
16 | 23 | # clone url... |
|
17 | 24 | assert """<input type="text" id="clone_url" readonly="readonly" value="hg clone http://test_admin@localhost:80/%s" size="70"/>""" % HG_REPO in response.body |
|
18 | 25 | |
|
19 | 26 | |
|
27 | def _enable_stats(self): | |
|
28 | r = Repository.by_repo_name(HG_REPO) | |
|
29 | r.enable_statistics = True | |
|
30 | self.sa.add(r) | |
|
31 | self.sa.commit() | |
|
32 |
General Comments 0
You need to be logged in to leave comments.
Login now