def test_introspect_routes(self): from ptah.manage import introspect from ptah.manage.introspect import IntrospectModule, RoutesView introspect.exclude = None ptah.view.register_route("test-introspect", "/test/introspect") global view @ptah.view.pview(route="test-introspect") def view(request): """ """ self.p_config.add_route("test-route", "/test/") self._init_ptah() request = DummyRequest() mod = IntrospectModule(None, request) res = RoutesView.__renderer__(mod, request) self.assertIn("Routes <small>registered pyramid routes</small>", res.body) self.assertIn("/test/", res.body) self.assertIn("/test/introspect", res.body) self.assertIn("Route view", res.body)
def test_introspect_routes(self): from ptah.manage import introspect from ptah.manage.introspect import IntrospectModule, RoutesView introspect.exclude = None ptah.view.register_route('test-introspect', '/test/introspect') global view @ptah.view.pview(route='test-introspect') def view(request): """ """ self.config.add_route('test-route', '/test/') self.init_ptah() request = DummyRequest() mod = IntrospectModule(None, request) res = RoutesView.__renderer__(mod, request) self.assertIn( "Routes <small>registered pyramid routes</small>", res.text) self.assertIn('/test/', res.text) self.assertIn('/test/introspect', res.text) self.assertIn('Route view', res.text)
def test_introspect_routes(self): from ptah.manage.introspect import IntrospectModule, RoutesView request = DummyRequest() mod = IntrospectModule(None, request) res = RoutesView.__renderer__(mod, request) self.assertIn("Routes <small>registered pyramid routes</small>", res.body)