Exemplo n.º 1
0
    def test_view_view(self):
        from ptah.manage.rest import RestModule, RestModuleView

        request = DummyRequest()

        mod = RestModule(None, request)

        res = render_view_to_response(mod, request, '', False)
        self.assertEqual(res.status, '200 OK')

        view = RestModuleView(mod, request)
        view.update()

        self.assertEqual(
            view.url, '{0}/__rest__/cms/'.format(request.application_url))
Exemplo n.º 2
0
    def test_view_view(self):
        from ptah.manage.rest import RestModule, RestModuleView

        request = DummyRequest()

        mod = RestModule(None, request)

        res = render_view_to_response(mod, request, '', False)
        self.assertEqual(res.status, '200 OK')

        view = RestModuleView(mod, request)
        view.update()

        self.assertEqual(view.url,
                         '{0}/__rest__/cms/'.format(request.application_url))
Exemplo n.º 3
0
    def test_view_view(self):
        from ptah.manage.rest import RestModule, RestModuleView

        request = DummyRequest()

        mod = RestModule(None, request)

        res = RestModuleView.__renderer__(mod, request)
        self.assertEqual(res.status, '200 OK')

        view = RestModuleView(mod, request)
        view.update()

        self.assertEqual(
            view.appurl, request.application_url)
        self.assertEqual(
            view.url, '%s/__rest__/cms/' % request.application_url)