allura
Revision | ce18b18506efe444a8908ba402d3073286ced926 (tree) |
---|---|
Time | 2012-04-17 01:23:24 |
Author | Evgeny Ivanov <jey.ivanov@gmai...> |
Commiter | Dave Brondsema |
t11: code cleaning
@@ -26,40 +26,40 @@ class TestWikiMacro(TestController): | ||
26 | 26 | projects_dict = dict([(p['name'],p[prop]) for p in projects]) |
27 | 27 | return [projects_dict[name] for name in names] |
28 | 28 | |
29 | - # @td.with_wiki | |
30 | - # def test_sort_alpha(self): | |
31 | - # r = self.app.post('/p/wiki/Home/update', | |
32 | - # params={ | |
33 | - # 'title': 'Home', | |
34 | - # 'text': '[[projects sort=alpha]]' | |
35 | - # }, | |
36 | - # extra_environ=dict(username='root'), upload_files=[]).follow() | |
37 | - # project_list = self.get_project_names(r) | |
38 | - # assert project_list == sorted(project_list) | |
29 | + @td.with_wiki | |
30 | + def test_sort_alpha(self): | |
31 | + r = self.app.post('/p/wiki/Home/update', | |
32 | + params={ | |
33 | + 'title': 'Home', | |
34 | + 'text': '[[projects sort=alpha]]' | |
35 | + }, | |
36 | + extra_environ=dict(username='root'), upload_files=[]).follow() | |
37 | + project_list = self.get_project_names(r) | |
38 | + assert project_list == sorted(project_list) | |
39 | 39 | |
40 | - # @td.with_wiki | |
41 | - # def test_sort_registered(self): | |
42 | - # r = self.app.post('/p/wiki/Home/update', | |
43 | - # params={ | |
44 | - # 'title': 'Home', | |
45 | - # 'text': '[[projects sort=last_registred]]' | |
46 | - # }, | |
47 | - # extra_environ=dict(username='root'), upload_files=[]).follow() | |
48 | - # project_names = self.get_project_names(r) | |
49 | - # ids = self.get_projects_property_in_the_same_order(project_names, '_id') | |
50 | - # assert ids == sorted(ids, reverse=True) | |
40 | + @td.with_wiki | |
41 | + def test_sort_registered(self): | |
42 | + r = self.app.post('/p/wiki/Home/update', | |
43 | + params={ | |
44 | + 'title': 'Home', | |
45 | + 'text': '[[projects sort=last_registred]]' | |
46 | + }, | |
47 | + extra_environ=dict(username='root'), upload_files=[]).follow() | |
48 | + project_names = self.get_project_names(r) | |
49 | + ids = self.get_projects_property_in_the_same_order(project_names, '_id') | |
50 | + assert ids == sorted(ids, reverse=True) | |
51 | 51 | |
52 | - # @td.with_wiki | |
53 | - # def test_sort_updated(self): | |
54 | - # r = self.app.post('/p/wiki/Home/update', | |
55 | - # params={ | |
56 | - # 'title': 'Home', | |
57 | - # 'text': '[[projects sort=last_updated]]' | |
58 | - # }, | |
59 | - # extra_environ=dict(username='root'), upload_files=[]).follow() | |
60 | - # project_names = self.get_project_names(r) | |
61 | - # updated_at = self.get_projects_property_in_the_same_order(project_names, 'last_updated') | |
62 | - # assert updated_at == sorted(updated_at, reverse=True) | |
52 | + @td.with_wiki | |
53 | + def test_sort_updated(self): | |
54 | + r = self.app.post('/p/wiki/Home/update', | |
55 | + params={ | |
56 | + 'title': 'Home', | |
57 | + 'text': '[[projects sort=last_updated]]' | |
58 | + }, | |
59 | + extra_environ=dict(username='root'), upload_files=[]).follow() | |
60 | + project_names = self.get_project_names(r) | |
61 | + updated_at = self.get_projects_property_in_the_same_order(project_names, 'last_updated') | |
62 | + assert updated_at == sorted(updated_at, reverse=True) | |
63 | 63 | |
64 | 64 | @td.with_wiki |
65 | 65 | def test_filtering(self): |