allura
Revisão | 3a256826539ed97e61b0e5045fef7103cf4a5ff0 (tree) |
---|---|
Hora | 2012-07-18 23:28:54 |
Autor | Igor Bondarenko <jetmind2@gmai...> |
Commiter | Dave Brondsema |
[#4349] ticket:119 add test and change projects lookups
@@ -178,7 +178,8 @@ class SiteAdminController(object): | ||
178 | 178 | c.page_size = W.page_size |
179 | 179 | limit, pagenum, start = g.handle_paging(limit, page, default=100) |
180 | 180 | count = 0 |
181 | - projects = (M.Project.query.find({'name': {'$regex': '^[^u][^/]'}}) | |
181 | + nb = M.Neighborhood.query.get(name='Users') | |
182 | + projects = (M.Project.query.find({'neighborhood_id': {'$ne': nb._id}}) | |
182 | 183 | .sort('_id', -1)) |
183 | 184 | count = projects.count() |
184 | 185 | projects = projects.skip(start).limit(limit) |
@@ -26,7 +26,7 @@ | ||
26 | 26 | <small>{{ p._id.generation_time.strftime('%Y-%m-%d %H:%M:%S') }}</small> |
27 | 27 | </td> |
28 | 28 | <td><small>{{ p.shortname }}</small></td> |
29 | - <td><small>{{ p.name }}</small></td> | |
29 | + <td><small><a href="{{ p.url() }}">{{ p.name }}</a></small></td> | |
30 | 30 | <td><small>{{ p.short_description }}</small></td> |
31 | 31 | <td><small>{{ p.summary }}</small></td> |
32 | 32 | <td><small>{{ 'Yes' if p.deleted else 'No' }}</small></td> |
@@ -47,3 +47,16 @@ class TestSiteAdmin(TestController): | ||
47 | 47 | r = self.app.get('/nf/admin/new_projects', extra_environ=dict( |
48 | 48 | username='*anonymous'), status=302).follow() |
49 | 49 | assert 'Login' in r |
50 | + | |
51 | + def test_new_projects(self): | |
52 | + r = self.app.get('/nf/admin/new_projects', extra_environ=dict( | |
53 | + username='root')) | |
54 | + headers = r.html.find('table').findAll('th') | |
55 | + assert headers[1].contents[0] == 'Created' | |
56 | + assert headers[2].contents[0] == 'Shortname' | |
57 | + assert headers[3].contents[0] == 'Name' | |
58 | + assert headers[4].contents[0] == 'Short description' | |
59 | + assert headers[5].contents[0] == 'Summary' | |
60 | + assert headers[6].contents[0] == 'Deleted?' | |
61 | + assert headers[7].contents[0] == 'Homepage' | |
62 | + assert headers[8].contents[0] == 'Admins' |