Changeset 56


Ignore:
Timestamp:
01/11/06 13:28:43 (14 years ago)
Author:
laszlo
Message:

fixes #147 spent 1h

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ConfigurationMethods.py

    r47 r56  
    102102        # Create folder 
    103103        addObject(portal,item.lower(),'Folder',item) 
    104         # Add action for portal tab 
    105         acts.append(ActionInformation(id=item.lower(), 
     104        flag = False 
     105        for action in acts: 
     106            if action.category == 'portal_tabs' and action.title == item: 
     107                flag = True 
     108        if not flag: 
     109            # Add action for portal tab 
     110            acts.append(ActionInformation(id=item.lower(), 
    106111                                      title=item, 
    107112                                      description=item, 
  • trunk/tests/testCustomization.py

    r47 r56  
    66from ToolboxTestCase import ToolboxTestCase 
    77from Testing.ZopeTestCase.functional import Functional 
     8from Products.CMFCore.utils import getToolByName 
    89 
     10from Products.Toolbox.ConfigurationMethods import ToolboxSetup 
    911from Products.Toolbox.config import * 
     12 
    1013 
    1114class TestCustomization(ToolboxTestCase,Functional): 
     
    3740                self.failUnless(action.Title() in SECTIONS, 
    3841                                'Visible tabs found that are not in SECTIONS: %s' % action.Title()) 
    39  
     42     
     43    def testSetupFolders(self): 
     44        self.loginAsPortalOwner() 
     45        pm=getToolByName(self.portal, 'portal_migration') 
     46        pm.installItems(ToolboxSetup.type,["setupFolders",]) 
     47        pa=getToolByName(self.portal, 'portal_actions') 
     48        acts = pa._cloneActions() 
     49        target=SECTIONS[0] 
     50        counter = 0 
     51        for action in acts: 
     52            if action.category == 'portal_tabs' and action.title == target: 
     53                counter+=1 
     54        self.failIf(counter != 1, 'Too many portal tabs.') 
     55         
    4056def test_suite(): 
    4157    from unittest import TestSuite, makeSuite 
Note: See TracChangeset for help on using the changeset viewer.