コード例 #1
0
ファイル: test_manage.py プロジェクト: webmaven/ptah
    def test_manage_layout(self):
        from ptah.manage.manage import module, PtahModule, LayoutManage

        @module("test-module")
        class TestModule(PtahModule):
            """ module description """

            title = "Test module"

        class Content(object):
            __parent__ = None

        self.init_ptah()

        mod = TestModule(None, self.request)
        content = Content()
        content.__parent__ = mod
        self.request.context = content

        layout = LayoutManage(mod, self.request)
        layout.viewcontext = content
        layout.context.userid = ""
        layout.update()

        self.assertIs(layout.module, mod)
コード例 #2
0
    def test_manage_layout(self):
        from ptah.manage.manage import \
            module, PtahModule, LayoutManage

        @module('test-module')
        class TestModule(PtahModule):
            """ module description """

            title = 'Test module'

        class Content(object):
            __parent__ = None

        self.init_ptah()

        mod = TestModule(None, self.request)
        content = Content()
        content.__parent__ = mod
        self.request.context = content

        layout = LayoutManage(mod, self.request)
        layout.viewcontext = content
        layout.context.userid = ''
        layout.update()

        self.assertIs(layout.module, mod)
コード例 #3
0
ファイル: test_manage.py プロジェクト: blaflamme/ptah
    def test_manage_layout(self):
        from ptah.manage.manage import \
            module, PtahModule, PtahManageRoute, LayoutManage

        global TestModule
        class TestModule(PtahModule):
            """ module description """

            title = 'Test module'
            module('test-module')

        class Content(object):
            __parent__ = None

        self._init_ptah()

        request = self._makeRequest()

        mod = TestModule(None, request)
        content = Content()
        content.__parent__ = mod
        request.context = content

        layout = LayoutManage(mod, request)
        layout.viewcontext = content
        layout.update()

        self.assertIs(layout.module, mod)
コード例 #4
0
ファイル: test_manage.py プロジェクト: sidloki/ptah
    def test_manage_layout(self):
        from ptah.manage.manage import \
            module, PtahModule, LayoutManage, root

        @module('test-module')
        class TestModule(PtahModule):
            """ module description """

            title = 'Test module'

        class Content(object):
            __parent__ = None

        self.init_ptah()

        mod = TestModule(root, self.request)
        content = Content()
        content.__parent__ = mod
        self.request.context = content

        layout = LayoutManage(self.request.context, self.request)

        self.assertEqual(layout.parents, [mod])