[Checkins] SVN: Products.GenericSetup/trunk/Products/GenericSetup/tests/test_tool.py Merged r100348 from branch 1.4

Vincent Fretin vincent.fretin at gmail.com
Sun May 24 16:37:47 EDT 2009


Log message for revision 100349:
  Merged r100348 from branch 1.4

Changed:
  U   Products.GenericSetup/trunk/Products/GenericSetup/tests/test_tool.py

-=-
Modified: Products.GenericSetup/trunk/Products/GenericSetup/tests/test_tool.py
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/tests/test_tool.py	2009-05-24 20:32:25 UTC (rev 100348)
+++ Products.GenericSetup/trunk/Products/GenericSetup/tests/test_tool.py	2009-05-24 20:37:47 UTC (rev 100349)
@@ -542,7 +542,29 @@
                                                    ignore_dependencies=False)
         self.assertEqual(_imported, [self._PROFILE_PATH2, self._PROFILE_PATH])
 
+    def test_runAllImportStepsFromProfile_set_last_profile_version(self):
+        from Products.GenericSetup.metadata import METADATA_XML
 
+        self._makeFile(METADATA_XML, _METADATA_XML)
+
+        site = self._makeSite()
+        tool = self._makeOne('setup_tool').__of__( site )
+
+        profile_registry.registerProfile('foo', 'Foo', '', self._PROFILE_PATH)
+
+        # test initial states
+        profile_id = "other:foo"
+        self.assertEqual(tool.getVersionForProfile(profile_id), '1.0')
+        self.assertEqual(tool.getLastVersionForProfile(profile_id),
+                         'unknown')
+
+        # run all imports steps
+        result = tool.runAllImportStepsFromProfile('profile-other:foo', ignore_dependencies=True)
+
+        # events.handleProfileImportedEvent should set last profile version
+        self.assertEqual(tool.getLastVersionForProfile(profile_id),
+                         ('1', '0'))
+
     def test_runAllImportStepsFromProfile_step_registration_with_depends(self):
         from Products.GenericSetup.metadata import METADATA_XML
 



More information about the Checkins mailing list