From 6ddb9a37376faaded9aac55965889779d78df7cd Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Wed, 18 Sep 2019 22:38:43 +0200 Subject: [PATCH] Skip uninstall test when CMFQuickInstallerTool is too old. --- plone/app/ldap/tests/test_controlpanel.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plone/app/ldap/tests/test_controlpanel.py b/plone/app/ldap/tests/test_controlpanel.py index 371e967..9b0a6d5 100644 --- a/plone/app/ldap/tests/test_controlpanel.py +++ b/plone/app/ldap/tests/test_controlpanel.py @@ -4,8 +4,16 @@ from plone.app.ldap.config import PROJECTNAME from plone.app.ldap.testing import INTEGRATION_TESTING +import pkg_resources import unittest +qi_dist = pkg_resources.get_distribution("Products.CMFQuickInstallerTool") +if qi_dist.parsed_version > pkg_resources.parse_version("3.0.9"): + # This version uses the uninstall profile. + SKIP_UNINSTALL_TEST = False +else: + SKIP_UNINSTALL_TEST = True + class ControlPanelTestCase(unittest.TestCase): @@ -32,6 +40,8 @@ def test_controlpanel_installed(self): a.getAction(self)['id'] for a in self.controlpanel.listActions()] self.assertIn('ldap', actions) + @unittest.skipIf(SKIP_UNINSTALL_TEST, + "uninstall not supported with this old quick installer") def test_controlpanel_removed_on_uninstall(self): qi = self.portal['portal_quickinstaller']