Back to index

plone3  3.1.7
testQuickInstallerTool.py
Go to the documentation of this file.
00001 #
00002 # QuickInstallerTool tests
00003 #
00004 
00005 from Products.CMFPlone.tests import PloneTestCase
00006 
00007 
00008 class TestQuickInstallerTool(PloneTestCase.PloneTestCase):
00009 
00010     def afterSetUp(self):
00011         self.qi = self.portal.portal_quickinstaller
00012 
00013     def _installed(self):
00014         return [p['id'] for p in self.qi.listInstalledProducts()]
00015 
00016     def _available(self):
00017         return [p['id'] for p in self.qi.listInstallableProducts()]
00018 
00019     def testInstallUninstallProduct(self):
00020         # CMFPlacefulWorkflow should be uninstalled, we install it and
00021         # it should not show up as installable
00022         self.setRoles(('Manager',))
00023         self.qi.installProducts(['CMFPlacefulWorkflow', ])
00024         self.failUnless('CMFPlacefulWorkflow' in self._installed())
00025         self.failIf('CMFPlacefulWorkflow' in self._available())
00026         self.qi.uninstallProducts(['CMFPlacefulWorkflow', ])
00027         self.failUnless('CMFPlacefulWorkflow' in self._available())
00028         self.failIf('CMFPlacefulWorkflow' in self._installed())
00029 
00030 
00031 def test_suite():
00032     from unittest import TestSuite, makeSuite
00033     suite = TestSuite()
00034     suite.addTest(makeSuite(TestQuickInstallerTool))
00035     return suite