Changeset 2874 in products


Ignore:
Timestamp:
Oct 15, 2010 1:27:43 PM (14 years ago)
Author:
mylan
Message:

#232: Added uninstallation tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/tests/test_installation.py

    r2873 r2874  
    1313DEPENDENCIES = ["plone.app.registry",] 
    1414CONFIGLETS = ["dropdownmenu",] 
     15#REGISTRY_INTERFACE = "quintagroup.dropdownmenu.interfaces.IDropDownMenuSettings" 
    1516 
    1617class TestInstallation(TestCase): 
     
    5051            "Not registered '%s' registry interface" % IPREFIX) 
    5152 
     53class TestUninstallation(TestCaseUnInstalled): 
     54 
     55    def testUninstalled(self): 
     56        qi = self.portal.portal_quickinstaller 
     57        self.assertFalse(qi.isProductInstalled(PROJECT_NAME), 
     58            '%s not uninstalled.' % PROJECT_NAME) 
     59 
     60    def testStyles(self): 
     61        """ Test styles registration.""" 
     62        cssreg = getToolByName(self.portal, "portal_css") 
     63        for res in CSS_RESOURCES: 
     64            self.assertEqual(cssreg.getResource(res), None) 
     65 
     66    def testConfiglet(self): 
     67        cp = self.portal.portal_controlpanel 
     68        configlets = [ai['id'] for ai in cp.listActionInfos(check_permissions=0)] 
     69        for cid in CONFIGLETS: 
     70            self.assertFalse([1 for ai in configlets if ai==cid],  
     71                '"%s" configlet not uninstalled from plone control panel' % cid) 
     72 
     73    def testBrowserLayer(self): 
     74        self.assertFalse(IDropDownMenuLayer in blutils.registered_layers(), 
     75                     "Not unregistered 'IDropDownMenuLayer' browser layer") 
     76 
     77    def testRegistry(self): 
     78        registry = queryUtility(IRegistry) 
     79        afield = "show_content_tabs" 
     80        self.assertFalse(registry.records.get(IPREFIX+afield, None), 
     81            "Not unregistered '%s' registry interface" % IPREFIX) 
     82 
    5283 
    5384def test_suite(): 
     
    5586    suite = TestSuite() 
    5687    suite.addTest(makeSuite(TestInstallation)) 
     88    suite.addTest(makeSuite(TestUninstallation)) 
    5789    return suite 
Note: See TracChangeset for help on using the changeset viewer.