Skip to content

Commit

Permalink
fix at-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pbauer committed Sep 21, 2015
1 parent fc3ad3e commit 3c7bd2b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Changelog
1.6.4 (unreleased)
------------------

- Nothing changed yet.
- Fix test after new default dependecy-strategy for GenericSetup.
[pbauer]


1.6.3 (2015-09-20)
Expand Down
23 changes: 22 additions & 1 deletion Products/CMFPlacefulWorkflow/tests/testCMFPlacefulWorkflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,32 @@ def test_marker_applied_and_unapplied(self):
Check that the IPlacefulMarker is applied to the workflow tool by
the install, and removed by the uninstall.
"""
try:
# GenericSetup 1.7.8 and higher
from Products.GenericSetup.tool import DEPENDENCY_STRATEGY_REAPPLY
DEPENDENCY_STRATEGY_REAPPLY # pyflakes
except ImportError:
DEPENDENCY_STRATEGY_REAPPLY = None

self.failUnless(IPlacefulMarker.providedBy(self.workflow))
self.loginAsPortalOwner()
self.qi.uninstallProducts(['CMFPlacefulWorkflow'])
self.failIf(IPlacefulMarker.providedBy(self.workflow))
self.qi.installProduct('CMFPlacefulWorkflow')

profile_id = 'Products.CMFPlacefulWorkflow:CMFPlacefulWorkflow'
if DEPENDENCY_STRATEGY_REAPPLY is None:
# Older GenericSetup. Reapply is the default. No alternative
# strategy can be given.
self.qi.installProduct('CMFPlacefulWorkflow')
# setup_tool.runAllImportStepsFromProfile('profile-%s' % profile_id)
else:
# Newer GenericSetup. Upgrade is the default. We want to
# reapply.
setup_tool = self.portal.portal_setup
setup_tool.runAllImportStepsFromProfile(
'profile-%s' % profile_id,
dependency_strategy=DEPENDENCY_STRATEGY_REAPPLY)

self.failUnless(IPlacefulMarker.providedBy(self.workflow))

def test_reinstall(self):
Expand Down

0 comments on commit 3c7bd2b

Please sign in to comment.