stop using sqlcatalog as dictionary

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34667 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8c5b4dd0
...@@ -564,11 +564,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -564,11 +564,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# but raises KeyError if object is not in catalog # but raises KeyError if object is not in catalog
self.assertRaises(KeyError, portal_catalog.getObject, sys.maxint) self.assertRaises(KeyError, portal_catalog.getObject, sys.maxint)
def test_getitem(self): def test_getRecordForUid(self):
portal_catalog = self.getCatalogTool() portal_catalog = self.getCatalogTool()
obj = self._makeOrganisation() obj = self._makeOrganisation()
self.assertEquals(obj, self.assertEquals(obj,
portal_catalog.getSQLCatalog()[obj.getUid()].getObject()) portal_catalog.getSQLCatalog().getRecordForUid(obj.getUid()).getObject())
def test_path(self): def test_path(self):
portal_catalog = self.getCatalogTool() portal_catalog = self.getCatalogTool()
......
...@@ -2340,6 +2340,7 @@ class TestPropertySheet: ...@@ -2340,6 +2340,7 @@ class TestPropertySheet:
""" """
if not run: return if not run: return
folder = self.getOrganisationModule() folder = self.getOrganisationModule()
sql_catalog = self.portal.portal_catalog.getSQLCatalog()
initial_id = 'foo' initial_id = 'foo'
final_id = 'bar' final_id = 'bar'
subdocument_id = 'sub' subdocument_id = 'sub'
...@@ -2353,8 +2354,8 @@ class TestPropertySheet: ...@@ -2353,8 +2354,8 @@ class TestPropertySheet:
self.tic() self.tic()
folder = self.getOrganisationModule() folder = self.getOrganisationModule()
subdocument = folder[final_id][subdocument_id] subdocument = folder[final_id][subdocument_id]
subdocument_catalogged_path = self.getPortalObject().portal_catalog.getSQLCatalog()[subdocument.uid].path subdocument_record = sql_catalog.getRecordForUid(subdocument.uid)
self.assertEqual(subdocument.getPath(), subdocument_catalogged_path) self.assertEqual(subdocument.getPath(), subdocument_record.path)
def test_getCreationDate(self, quiet=quiet, run=run_all_test): def test_getCreationDate(self, quiet=quiet, run=run_all_test):
""" """
......
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