Commit 0b7ef6ad authored by Vincent Pelletier's avatar Vincent Pelletier

Remove test_renameObjectsPreservesUid: it is not a required feature. What is...

Remove test_renameObjectsPreservesUid: it is not a required feature. What is costly in renaming an object is updating all relations pointing at (or traversing) renamed object. Updating the uid in category table is "just" a consequence from this, and will be done anyway - even if uid is the same.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18552 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3351ae39
...@@ -1838,28 +1838,6 @@ class TestPropertySheet: ...@@ -1838,28 +1838,6 @@ class TestPropertySheet:
self.assertRaises(ValueError, getattr, not_ok, 'attr') self.assertRaises(ValueError, getattr, not_ok, 'attr')
self.assertFalse(hasattr(not_ok, 'attr')) self.assertFalse(hasattr(not_ok, 'attr'))
def test_renameObjectsPreservesUid(self, quiet=quiet, run=run_all_test):
"""Test that object renaming preserves original uid.
This features allows to avoid reindexing all related objects, as it
can be extremely costly.
"""
if not run: return
folder = self.getOrganisationModule()
initial_id = 'foo'
final_id = 'bar'
folder.newContent(portal_type='Organisation', id=initial_id)
get_transaction().commit()
self.tic()
folder = self.getOrganisationModule()
document = folder[initial_id]
initial_uid = document.uid
folder.manage_renameObjects([initial_id], [final_id])
get_transaction().commit()
self.tic()
folder = self.getOrganisationModule()
document = folder[final_id]
self.assertEqual(initial_uid, document.uid)
def test_renameObjectsReindexSubobjects(self, quiet=quiet, run=run_all_test): def test_renameObjectsReindexSubobjects(self, quiet=quiet, run=run_all_test):
"""Test that renaming an object with subobjects causes them to be """Test that renaming an object with subobjects causes them to be
reindexed (their path must be updated). reindexed (their path must be updated).
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment