allura
Révision | b2ab29384248122814c12ae63e29ab65497b3bee (tree) |
---|---|
l'heure | 2012-07-17 18:37:53 |
Auteur | Igor Bondarenko <jetmind2@gmai...> |
Commiter | Igor Bondarenko |
[#4349] ticket:119 add test and change projects lookups
@@ -115,7 +115,8 @@ class SiteAdminController(object): | ||
115 | 115 | c.page_size = W.page_size |
116 | 116 | limit, pagenum, start = g.handle_paging(limit, page, default=100) |
117 | 117 | count = 0 |
118 | - projects = (M.Project.query.find({'name': {'$regex': '^[^u][^/]'}}) | |
118 | + nb = M.Neighborhood.query.get(name='Users') | |
119 | + projects = (M.Project.query.find({'neighborhood_id': {'$ne': nb._id}}) | |
119 | 120 | .sort('_id', -1)) |
120 | 121 | count = projects.count() |
121 | 122 | 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' |