[Checkins] SVN: Products.GenericSetup/branches/1.4/Products/GenericSetup/ LP #553338
Tres Seaver
tseaver at palladion.com
Thu Apr 1 15:37:16 EDT 2010
Log message for revision 110435:
LP #553338
Fixed bug which broke the took upgrade tab after running an upgrade step
which used ``None`` as its destintaion version.
Changed:
U Products.GenericSetup/branches/1.4/Products/GenericSetup/CHANGES.txt
U Products.GenericSetup/branches/1.4/Products/GenericSetup/tests/test_tool.py
U Products.GenericSetup/branches/1.4/Products/GenericSetup/tool.py
-=-
Modified: Products.GenericSetup/branches/1.4/Products/GenericSetup/CHANGES.txt
===================================================================
--- Products.GenericSetup/branches/1.4/Products/GenericSetup/CHANGES.txt 2010-04-01 18:52:33 UTC (rev 110434)
+++ Products.GenericSetup/branches/1.4/Products/GenericSetup/CHANGES.txt 2010-04-01 19:37:16 UTC (rev 110435)
@@ -4,7 +4,9 @@
1.4.6 (Unreleased)
------------------
-- TBD
+- Fixed bug which broke the took upgrade tab after running an upgrade step
+ which used ``None`` as its destintaion version.
+ https://bugs.launchpad.net/bugs/553338
1.4.5 (2009-06-20)
Modified: Products.GenericSetup/branches/1.4/Products/GenericSetup/tests/test_tool.py
===================================================================
--- Products.GenericSetup/branches/1.4/Products/GenericSetup/tests/test_tool.py 2010-04-01 18:52:33 UTC (rev 110434)
+++ Products.GenericSetup/branches/1.4/Products/GenericSetup/tests/test_tool.py 2010-04-01 19:37:16 UTC (rev 110435)
@@ -968,6 +968,35 @@
(profile_registry._profile_info,
profile_registry._profile_ids) = orig_profile_reg
+ def test_manage_doUpgrades_no_profile_id_or_updates(self):
+ site = self._makeSite()
+ site.setup_tool = self._makeOne('setup_tool')
+ tool = site.setup_tool
+ request = site.REQUEST
+ tool.manage_doUpgrades()
+ self.assertEqual(tool._profile_upgrade_versions, {})
+
+ def test_manage_doUpgrades_upgrade_w_no_target_version(self):
+ from Products.GenericSetup.upgrade import UpgradeStep
+ from Products.GenericSetup.upgrade import _registerUpgradeStep
+ from Products.GenericSetup.upgrade import _upgrade_registry
+ old = dict(_upgrade_registry._registry)
+ try:
+ step = UpgradeStep('TITLE', 'foo', '*', '*', 'DESC',
+ lambda tool: None)
+ _registerUpgradeStep(step)
+ site = self._makeSite()
+ site.setup_tool = self._makeOne('setup_tool')
+ tool = site.setup_tool
+ request = site.REQUEST
+ request['profile_id'] = ['foo']
+ request['upgrade'] = [step.id]
+ tool.manage_doUpgrades()
+ self.assertEqual(tool._profile_upgrade_versions, {})
+ finally:
+ _upgrade_registry._registry.clear()
+ _upgrade_registry._registry.update(old)
+
def test_listExportSteps(self):
site = self._makeSite()
site.setup_tool = self._makeOne('setup_tool')
Modified: Products.GenericSetup/branches/1.4/Products/GenericSetup/tool.py
===================================================================
--- Products.GenericSetup/branches/1.4/Products/GenericSetup/tool.py 2010-04-01 18:52:33 UTC (rev 110434)
+++ Products.GenericSetup/branches/1.4/Products/GenericSetup/tool.py 2010-04-01 19:37:16 UTC (rev 110435)
@@ -968,7 +968,8 @@
# We update the profile version to the last one we have reached
# with runnning an upgrade step.
- self.setLastVersionForProfile(profile_id, step.dest)
+ if step and step.dest is not None:
+ self.setLastVersionForProfile(profile_id, step.dest)
url = self.absolute_url()
request.RESPONSE.redirect("%s/manage_upgrades?saved=%s" % (url, profile_id))
More information about the checkins
mailing list