Пример #1
0
 def test_render_on_content_inside_groupspace(self):
     # TODO: Pass any keyword arguments to the Assignment constructor
     r = self.renderer(context=self.document,
                       assignment=groupmailportlet.Assignment())
     r = r.__of__(self.document)
     r.update()
     output = r.render()
Пример #2
0
    def test_obtain_renderer(self):
        context = self.folder
        request = self.folder.REQUEST
        view = self.folder.restrictedTraverse('@@plone')
        manager = getUtility(IPortletManager,
                             name='plone.rightcolumn',
                             context=self.portal)

        # TODO: Pass any keywoard arguments to the Assignment constructor
        assignment = groupmailportlet.Assignment()

        renderer = getMultiAdapter(
            (context, request, view, manager, assignment), IPortletRenderer)
        self.failUnless(isinstance(renderer, groupmailportlet.Renderer))
Пример #3
0
    def renderer(self,
                 context=None,
                 request=None,
                 view=None,
                 manager=None,
                 assignment=None):
        context = context or self.folder
        request = request or self.folder.REQUEST
        view = view or self.folder.restrictedTraverse('@@plone')
        manager = manager or getUtility(
            IPortletManager, name='plone.rightcolumn', context=self.portal)

        # TODO: Pass any default keywoard arguments to the Assignment constructor
        assignment = assignment or groupmailportlet.Assignment()
        return getMultiAdapter((context, request, view, manager, assignment),
                               IPortletRenderer)
Пример #4
0
 def test_interfaces(self):
     # TODO: Pass any keywoard arguments to the Assignment constructor
     portlet = groupmailportlet.Assignment()
     self.failUnless(IPortletAssignment.providedBy(portlet))
     self.failUnless(IPortletDataProvider.providedBy(portlet.data))