def _get_view(self, request, path): """Get the view for the path specified.""" resource_path, action = parse_url(path) model = self.resource_factory.get_resource_at_path(resource_path) return get_view(model, action, request, self.execution_context)
def test_path_view(self): path, view = parse_url('/some/path/+view') self.assertEqual('/some/path', path) self.assertEqual('view', view)
def test_root_view(self): path, view = parse_url('/+listing') self.assertEqual('/', path) self.assertEqual('listing', view)
def test_path(self): path, view = parse_url('/some/path') self.assertEqual('/some/path', path) self.assertIs(None, view)
def test_root(self): path, view = parse_url('/') self.assertEqual('/', path) self.assertIs(None, view)