def test_sqla_table_view_model_nodes(self): from ptah.manage.sqla import SQLAModule, TableView rec = TestSqlaModuleContent(title='test') ptah.cms.Session.add(rec) ptah.cms.Session.flush() uri = rec.__uri__ type_uri = rec.__type__.__uri__ request = DummyRequest(params={'batch': 1}) mod = SQLAModule(None, request) table = mod['psqla-ptah_nodes'] res = render_view_to_response(table, request, '', False).text self.assertIn(url_quote_plus(uri), res) self.assertIn(url_quote_plus(type_uri), res) request = DummyRequest(params={'batch': 'unknown'}) res = render_view_to_response(table, request, '', False).text self.assertIn(url_quote_plus(uri), res) request = DummyRequest(params={'batch': '0'}) res = render_view_to_response(table, request, '', False).text self.assertIn(url_quote_plus(uri), res)
def quote(self, val): return url_quote_plus(val)