A typical testing fixture looks like this where we all use applyProfile()
for installing our add-ons involved in a particular fixture:
33 def setUpPloneSite(self, portal):
34 """Set up a Plone site.
35 """
36 applyProfile(portal, "plone.app.contenttypes:default")
37 applyProfile(portal, "ugent.foldersorting:default")
Most add-ons have generated tests for testing the install/uninstall dance and use isProductInstalled()
.
However this is not symmetric with applyProfile()
.
An installed profile does not show up in listInstalledProducts()
(Pdb) portal.portal_quickinstaller.listInstalledProducts()
[]
Only after an explicit installProduct()
call, the add-on is really installed and can be tested for being installed:
''
(Pdb) portal.portal_quickinstaller.listInstalledProducts()
[{'id': 'ugent.foldersorting', 'title': 'ugent.foldersorting', 'status': 'installed', 'hasError': False, 'isLocked': False, 'isHidden': False, 'installedVersion': '0.2'}]
(Pdb) portal.portal_quickinstaller.isProductInstalled('ugent.foldersorting')
True
Anything missing here?