Changeset 2921
- Timestamp:
- 02/20/07 18:50:29 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/controllers/extents.py
r2920 r2921 52 52 pass 53 53 54 def show(self, id, format='html'):54 def show(self, db_id, id, format='html'): 55 55 """GET /id: Show a specific item.""" 56 56 # url_for('extent', id=ID) 57 pass 57 db = self.dbs[db_id] 58 c.db_label = label(db) 59 c.db_url = h.url_for('database', id=db_id) 60 extent = db.extent(id) 61 c.extent_label = label(extent) 62 c.extent_plural = plural(extent) 63 c.extent_len = len(extent) 64 c.extent_name = extent.name 65 c.transactions = transactions = [] 66 for tx_name in list(extent.t): 67 tx_url = '#' # XXX: make real 68 tx_method = extent.t[tx_name] 69 tx_label = label(tx_method) 70 transactions.append((tx_label, tx_url)) 71 return render_response('extents.show') 58 72 59 73 def edit(self, id, format='html'): sandbox/mscott/SchevoPylonsNav/trunk/schevopylonsnav/tests/functional/test_extents.py
r2916 r2921 1 1 from schevopylonsnav.tests import * 2 2 3 3 4 class TestExtentsController(TestController): … … 7 8 assert 'Foo' in response 8 9 assert url_for('extent', db_id='db', id='Foo') in response 10 11 def test_show(self): 12 response = self.app.get(url_for('extent', db_id='db', id='Foo')) 13 assert 'Foo' in response # extent name and singular label 14 assert 'Foos' in response # plural label 15 assert '0' in response # length 16 assert 'Transaction Methods' in response 17 assert 'Create' in response 18 # XXX: test transaction URL
