Changeset 3681 in products


Ignore:
Timestamp:
Apr 30, 2013 2:48:15 PM (7 years ago)
Author:
mike
Message:

reback renderViewlet method; remove test_kssRegistry test

Location:
quintagroup.plonetabs/branches/nokss/quintagroup/plonetabs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonetabs/branches/nokss/quintagroup/plonetabs/browser/plonetabs.py

    r3680 r3681  
    1717    # Plone >= 4.3 
    1818    from zope.container.interfaces import INameChooser 
     19 
     20from zope.viewlet.interfaces import IViewletManager, IViewlet 
    1921 
    2022from plone.app.layout.navigation.root import getNavigationRoot 
     
    922924        return True 
    923925 
     926    def renderViewlet(self, manager, name): 
     927        if isinstance(manager, basestring): 
     928            manager = getMultiAdapter((self.context, self.request, self,), 
     929                                      IViewletManager, name=manager) 
     930        renderer = getMultiAdapter((self.context, self.request, self, manager), 
     931                                   IViewlet, name=name) 
     932        renderer = renderer.__of__(self.context) 
     933        renderer.update() 
     934        return renderer.render() 
    924935    # 
    925936    # Basic API to work with portal actions tool in a more pleasent way 
  • quintagroup.plonetabs/branches/nokss/quintagroup/plonetabs/tests/test_setup.py

    r3608 r3681  
    4848                    'script registered.') 
    4949 
    50     def test_kssRegistry(self): 
    51         tool = getToolByName(self.portal, 'portal_kss') 
    52         kss = tool.getResource('++resource++plonetabs.kss') 
    53         self.failIf(kss is None, 
    54                     'There is no ++resource++plonetabs.kss sheets registered.') 
    55         kss = tool.getResource('++resource++plonetabsmode.kss') 
    56         self.failIf(kss is None, 'There is no ++resource++plonetabsmode.kss ' 
    57                     'sheets registered.') 
    58  
    5950    def test_propertiesTool(self): 
    6051        tool = getToolByName(self.portal, 'portal_properties') 
Note: See TracChangeset for help on using the changeset viewer.