Mercurial > kallithea
annotate rhodecode/tests/functional/test_summary.py @ 1548:cba42a9e9164 beta
fixed tests for new vcs localtime changes
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 12 Oct 2011 00:29:13 +0200 |
parents | 04027bdb876c |
children | 54687aa00724 3246fcce2402 |
rev | line source |
---|---|
547
1e757ac98988
renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
1 from rhodecode.tests import * |
1080
c334e972f459
fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
2 from rhodecode.model.db import Repository |
c334e972f459
fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
3 from rhodecode.lib.utils import invalidate_cache |
82
670713507d03
Moved summary to seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff
changeset
|
4 |
670713507d03
Moved summary to seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff
changeset
|
5 class TestSummaryController(TestController): |
670713507d03
Moved summary to seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff
changeset
|
6 |
670713507d03
Moved summary to seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff
changeset
|
7 def test_index(self): |
473
6b934c9607e7
Improved testing scenarios. Made test env creator
Marcin Kuzminski <marcin@python-works.com>
parents:
459
diff
changeset
|
8 self.log_user() |
1366
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
9 response = self.app.get(url(controller='summary', |
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
10 action='index', repo_name=HG_REPO)) |
688
8acbfa837180
Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents:
567
diff
changeset
|
11 |
8acbfa837180
Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents:
567
diff
changeset
|
12 #repo type |
1366
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
13 self.assertTrue("""<img style="margin-bottom:2px" class="icon" """ |
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
14 """title="Mercurial repository" alt="Mercurial """ |
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
15 """repository" src="/images/icons/hgicon.png"/>""" |
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
16 in response.body) |
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
17 self.assertTrue("""<img style="margin-bottom:2px" class="icon" """ |
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
18 """title="public repository" alt="public """ |
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
19 """repository" src="/images/icons/lock_open.png"/>""" |
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
20 in response.body) |
688
8acbfa837180
Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents:
567
diff
changeset
|
21 |
8acbfa837180
Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents:
567
diff
changeset
|
22 #codes stats |
1366
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
23 self._enable_stats() |
1080
c334e972f459
fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
24 |
c334e972f459
fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
25 |
c334e972f459
fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
26 invalidate_cache('get_repo_cached_%s' % HG_REPO) |
1366
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
27 response = self.app.get(url(controller='summary', action='index', |
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
28 repo_name=HG_REPO)) |
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
29 |
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
30 self.assertTrue("""var data = {"py": {"count": 42, "desc": """ |
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
31 """["Python"]}, "rst": {"count": 11, "desc": """ |
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
32 """["Rst"]}, "sh": {"count": 2, "desc": ["Bash"]}, """ |
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
33 """"makefile": {"count": 1, "desc": ["Makefile", """ |
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
34 """"Makefile"]}, "cfg": {"count": 1, "desc": ["Ini"]},""" |
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
35 """ "css": {"count": 1, "desc": ["Css"]}, "bat": """ |
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
36 """{"count": 1, "desc": ["Batch"]}};""" |
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
37 in response.body) |
688
8acbfa837180
Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents:
567
diff
changeset
|
38 |
8acbfa837180
Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents:
567
diff
changeset
|
39 # clone url... |
1366
9c0f5d558789
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
40 self.assertTrue("""<input type="text" id="clone_url" readonly="readonly" value="hg clone http://test_admin@localhost:80/%s" size="70"/>""" % HG_REPO in response.body) |
782
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
41 |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
42 |
1080
c334e972f459
fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
43 def _enable_stats(self): |
1530
04027bdb876c
Refactoring of model get functions
Marcin Kuzminski <marcin@python-works.com>
parents:
1366
diff
changeset
|
44 r = Repository.get_by_repo_name(HG_REPO) |
1080
c334e972f459
fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
45 r.enable_statistics = True |
c334e972f459
fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
46 self.sa.add(r) |
c334e972f459
fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
47 self.sa.commit() |