• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


Commit MetaInfo

Revisiónb2ab29384248122814c12ae63e29ab65497b3bee (tree)
Tiempo2012-07-17 18:37:53
AutorIgor Bondarenko <jetmind2@gmai...>
CommiterIgor Bondarenko

Log Message

[#4349] ticket:119 add test and change projects lookups

Cambiar Resumen

Diferencia incremental

--- a/Allura/allura/controllers/site_admin.py
+++ b/Allura/allura/controllers/site_admin.py
@@ -115,7 +115,8 @@ class SiteAdminController(object):
115115 c.page_size = W.page_size
116116 limit, pagenum, start = g.handle_paging(limit, page, default=100)
117117 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}})
119120 .sort('_id', -1))
120121 count = projects.count()
121122 projects = projects.skip(start).limit(limit)
--- a/Allura/allura/templates/site_admin_new_projects.html
+++ b/Allura/allura/templates/site_admin_new_projects.html
@@ -26,7 +26,7 @@
2626 <small>{{ p._id.generation_time.strftime('%Y-%m-%d %H:%M:%S') }}</small>
2727 </td>
2828 <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>
3030 <td><small>{{ p.short_description }}</small></td>
3131 <td><small>{{ p.summary }}</small></td>
3232 <td><small>{{ 'Yes' if p.deleted else 'No' }}</small></td>
--- a/Allura/allura/tests/functional/test_site_admin.py
+++ b/Allura/allura/tests/functional/test_site_admin.py
@@ -47,3 +47,16 @@ class TestSiteAdmin(TestController):
4747 r = self.app.get('/nf/admin/new_projects', extra_environ=dict(
4848 username='*anonymous'), status=302).follow()
4949 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'