Commit 9cd3d20b authored by Jérome Perrin's avatar Jérome Perrin

testERP5Catalog py3

parent ca0f74ee
...@@ -572,7 +572,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -572,7 +572,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# otherwise it returns the object # otherwise it returns the object
self.assertEqual(obj, portal_catalog.getObject(obj.getUid()).getObject()) self.assertEqual(obj, portal_catalog.getObject(obj.getUid()).getObject())
# 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, -1)
def test_getRecordForUid(self): def test_getRecordForUid(self):
portal_catalog = self.getCatalogTool() portal_catalog = self.getCatalogTool()
...@@ -584,7 +584,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -584,7 +584,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
portal_catalog = self.getCatalogTool() portal_catalog = self.getCatalogTool()
obj = self._makeOrganisation() obj = self._makeOrganisation()
self.assertEqual(obj.getPath(), portal_catalog.getpath(obj.getUid())) self.assertEqual(obj.getPath(), portal_catalog.getpath(obj.getUid()))
self.assertRaises(KeyError, portal_catalog.getpath, sys.maxint) self.assertRaises(KeyError, portal_catalog.getpath, -1)
def test_16_newUid(self): def test_16_newUid(self):
# newUid should not assign the same uid # newUid should not assign the same uid
...@@ -1653,7 +1653,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1653,7 +1653,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
def test_54_FixIntUid(self): def test_54_FixIntUid(self):
if six.PY3: if six.PY3:
return unittest.skipTest( return unittest.SkipTest(
"Python3 does not have different types for int and long") "Python3 does not have different types for int and long")
portal = self.getPortal() portal = self.getPortal()
...@@ -3328,7 +3328,7 @@ VALUES ...@@ -3328,7 +3328,7 @@ VALUES
def test_reindexWithGroupId(self): def test_reindexWithGroupId(self):
CatalogTool = type(self.getCatalogTool().aq_base) CatalogTool = type(self.getCatalogTool().aq_base)
counts = [] counts = []
orig_catalogObjectList = CatalogTool.catalogObjectList.__func__ orig_catalogObjectList = CatalogTool.catalogObjectList
def catalogObjectList(self, object_list, *args, **kw): def catalogObjectList(self, object_list, *args, **kw):
counts.append(len(object_list)) counts.append(len(object_list))
return orig_catalogObjectList(self, object_list, *args, **kw) return orig_catalogObjectList(self, object_list, *args, **kw)
...@@ -4132,7 +4132,7 @@ VALUES ...@@ -4132,7 +4132,7 @@ VALUES
self.assertEqual(six.moves.http_client.OK, ret.getStatus()) self.assertEqual(six.moves.http_client.OK, ret.getStatus())
# check if we did not just publish the result of `str(portal_catalog.__call__())`, # check if we did not just publish the result of `str(portal_catalog.__call__())`,
# but a proper page # but a proper page
self.assertIn('<title>Catalog Tool - portal_catalog', ret.getBody()) self.assertIn(b'<title>Catalog Tool - portal_catalog', ret.getBody())
def testSearchNonAsciiWithTheInitUser(self): def testSearchNonAsciiWithTheInitUser(self):
""" """
......
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