source: products/quintagroup.plonecomments/trunk/quintagroup/plonecomments/tests/testQPloneCommentsUninstall.py @ 1222

Last change on this file since 1222 was 965, checked in by crchemist, 17 years ago

Created dir for testing bundles

File size: 2.0 KB
Line 
1#
2# Test product's uninstallation
3#
4
5import unittest
6
7from base import getToolByName, TestErase
8from config import PRODUCT, PRODUCT_SKIN_NAME, CONFIGLET_ID, PROPERTY_SHEET
9
10
11class TestUninstallation(TestErase):
12
13    def afterSetUp(self):
14        self.loginAsPortalOwner()
15        self.qi = self.portal.portal_quickinstaller
16
17    def test_package_uninstall(self):
18        self.failIf(self.qi.isProductInstalled(PRODUCT),
19            '%s is not uninstalled.' % PRODUCT)
20
21    def test_skins_uninstall(self):
22        skinstool=getToolByName(self.portal, 'portal_skins')
23        self.failIf(PRODUCT_SKIN_NAME in skinstool.objectIds(),
24            'There is still %s folder in portal_skins.' % PRODUCT_SKIN_NAME)
25        for skin in skinstool.getSkinSelections():
26            path = skinstool.getSkinPath(skin)
27            layers = map(str.strip, path.split(','))
28            self.failIf(PRODUCT_SKIN_NAME in layers,
29                '%s layer is still in %s.' % (PRODUCT_SKIN_NAME, skin))
30
31    def test_layer_uninstall(self):
32        from plone.browserlayer.utils import registered_layers
33        from quintagroup.plonecomments.interfaces import IPloneCommentsLayer
34        self.failIf(IPloneCommentsLayer in registered_layers(),
35            '%s layer found after uninstallation.' % IPloneCommentsLayer.getName())
36
37    def test_configlet_uninstall(self):
38        configTool = getToolByName(self.portal, 'portal_controlpanel', None)
39        self.failIf(CONFIGLET_ID in [a.getId() for a in configTool.listActions()],
40            'Configlet %s found after uninstallation.' % CONFIGLET_ID)
41
42    def test_propertysheet_uninstall(self):
43        portal_properties = getToolByName(self.portal, 'portal_properties')
44        self.failUnless(PROPERTY_SHEET in portal_properties.objectIds(),
45            '%s property_sheet not found in portal_properties after uninstallation.' % PROPERTY_SHEET)
46
47def test_suite():
48    from unittest import TestSuite, makeSuite
49    suite = TestSuite()
50    suite.addTest(makeSuite(TestUninstallation))
51    return suite
Note: See TracBrowser for help on using the repository browser.