예제 #1
0
파일: test_sqla.py 프로젝트: runyaga/ptah
    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)
예제 #2
0
    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)
예제 #3
0
파일: sqla.py 프로젝트: carlicos/ptah
 def quote(self, val):
     return url_quote_plus(val)
예제 #4
0
파일: sqla.py 프로젝트: runyaga/ptah
 def quote(self, val):
     return url_quote_plus(val)