Exemplo n.º 1
0
    def test_invoke_edit_view(self):
        # NOTE: This test can be removed if the portlet has no edit form
        mapping = PortletAssignmentMapping()
        request = self.portal.REQUEST

        mapping["foo"] = rerportletadvancedstatic.Assignment()
        editview = getMultiAdapter((mapping["foo"], request), name="edit")
        self.failUnless(isinstance(editview,
                                   rerportletadvancedstatic.EditForm))
Exemplo n.º 2
0
    def test_render(self):
        context = self.portal
        request = self.portal.REQUEST
        view = self.portal.restrictedTraverse("@@plone")
        manager = getUtility(IPortletManager,
                             name="plone.leftcolumn",
                             context=self.portal)
        assignment = rerportletadvancedstatic.Assignment()

        renderer = getMultiAdapter(
            (context, request, view, manager, assignment), IPortletRenderer)
        self.assertTrue(isinstance(renderer,
                                   rerportletadvancedstatic.Renderer))
Exemplo n.º 3
0
    def test_obtain_renderer(self):
        context = self.portal
        request = self.portal.REQUEST
        view = self.portal.restrictedTraverse("@@plone")
        manager = getUtility(IPortletManager,
                             name="plone.rightcolumn",
                             context=self.portal)

        # TODO: Pass any keyword arguments to the Assignment constructor
        assignment = rerportletadvancedstatic.Assignment()

        renderer = getMultiAdapter(
            (context, request, view, manager, assignment), IPortletRenderer)
        self.failUnless(isinstance(renderer,
                                   rerportletadvancedstatic.Renderer))
Exemplo n.º 4
0
    def renderer(
        self,
        context=None,
        request=None,
        view=None,
        manager=None,
        assignment=None,
    ):
        context = context or self.portal
        request = request or self.portal.REQUEST
        view = view or self.portal.restrictedTraverse("@@plone")
        manager = manager or getUtility(
            IPortletManager, name="plone.rightcolumn", context=self.portal)

        # TODO: Pass any default keyword arguments to the Assignment
        # constructor.
        assignment = assignment or rerportletadvancedstatic.Assignment()
        return getMultiAdapter((context, request, view, manager, assignment),
                               IPortletRenderer)
Exemplo n.º 5
0
 def test_interfaces(self):
     # TODO: Pass any keyword arguments to the Assignment constructor
     portlet = rerportletadvancedstatic.Assignment()
     self.failUnless(IPortletAssignment.providedBy(portlet))
     self.failUnless(IPortletDataProvider.providedBy(portlet.data))