• 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

Revisão3a256826539ed97e61b0e5045fef7103cf4a5ff0 (tree)
Hora2012-07-18 23:28:54
AutorIgor Bondarenko <jetmind2@gmai...>
CommiterDave Brondsema

Mensagem de Log

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

Mudança Sumário

Diff

--- a/Allura/allura/controllers/site_admin.py
+++ b/Allura/allura/controllers/site_admin.py
@@ -178,7 +178,8 @@ class SiteAdminController(object):
178178 c.page_size = W.page_size
179179 limit, pagenum, start = g.handle_paging(limit, page, default=100)
180180 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}})
182183 .sort('_id', -1))
183184 count = projects.count()
184185 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'