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)
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)
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)
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])