Skip to content

Commit

Permalink
Improved the uninstall test.
Browse files Browse the repository at this point in the history
svn path=/collective.sharerizer/trunk/; revision=251774
  • Loading branch information
mauritsvanrees committed Nov 27, 2012
1 parent 57bc99d commit 4948579
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions collective/sharerizer/tests/test_unittests.py
Expand Up @@ -2,25 +2,22 @@
from Products.CMFCore.utils import getToolByName
from collective.sharerizer.tests.base import FunctionalTestCase


class TestUninstallation(FunctionalTestCase):

def testUninstallationLeavesNoCruft(self):
# GS doesn't remove our changes to portal_properties or
# portal_controlpanel

# uninstall our product
# XXX: for some reason, our uninstall function isn't getting called
# during testing, but is during normal use.
qi = getToolByName(self.portal, "portal_quickinstaller")
qi.uninstallProducts(products=['collective.sharerizer',])
qi.uninstallProducts(products=['collective.sharerizer'])

# no property sheet in portal_properties
portal_properties = getToolByName(self.portal, "portal_properties")
self.failIf(hasattr(portal_properties, 'sharerizer'))

# no configlet registered
controlpanel = getToolByName(self.portal, "portal_controlpanel")
self.failIf(hasattr(portal_properties, 'sharerizer'))
self.failIf(controlpanel.getActionObject('Products/sharerizer'))


def test_suite():
suite = unittest.TestSuite()
Expand Down

0 comments on commit 4948579

Please sign in to comment.