Did I find the right examples for you? yes no

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)

src/c/o/collective.portlet.quote-1.0.1/collective/portlet/quote/tests/test_portlet.py   collective.portlet.quote(Download)
    def test_interfaces(self):
        # TODO: Pass any keyword arguments to the Assignment constructor
        portlet = randomquote.Assignment()
        self.failUnless(IPortletAssignment.providedBy(portlet))
        self.failUnless(IPortletDataProvider.providedBy(portlet.data))
 
        self.assertEquals(len(mapping), 1)
        self.failUnless(isinstance(mapping.values()[0],
                                   randomquote.Assignment))
 
        mapping['foo'] = randomquote.Assignment()
        editview = getMultiAdapter((mapping['foo'], request), name='edit')
        self.failUnless(isinstance(editview, randomquote.EditForm))
 
    def test_obtain_renderer(self):
        renderer = getMultiAdapter(
            (context, request, view, manager, assignment), IPortletRenderer)
        self.failUnless(isinstance(renderer, randomquote.Renderer))