Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
0c539b1a
Commit
0c539b1a
authored
Apr 04, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: don't use sys.maxint for python3 compatibility
use sys.maxsize, see discussion on
!1751 (comment 203735)
parent
7a429a7c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Catalog.py
...mplateItem/portal_components/test.erp5.testERP5Catalog.py
+4
-2
product/ERP5Type/tests/ERP5TypeTestSuite.py
product/ERP5Type/tests/ERP5TypeTestSuite.py
+1
-1
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Catalog.py
View file @
0c539b1a
...
@@ -571,7 +571,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -571,7 +571,8 @@ 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
,
sys
.
maxsize
)
self
.
assertRaises
(
KeyError
,
portal_catalog
.
getObject
,
-
1
)
def
test_getRecordForUid
(
self
):
def
test_getRecordForUid
(
self
):
portal_catalog
=
self
.
getCatalogTool
()
portal_catalog
=
self
.
getCatalogTool
()
...
@@ -583,7 +584,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -583,7 +584,8 @@ 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
,
sys
.
maxsize
)
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
...
...
product/ERP5Type/tests/ERP5TypeTestSuite.py
View file @
0c539b1a
...
@@ -148,7 +148,7 @@ class SavedTestSuite(ERP5TypeTestSuite):
...
@@ -148,7 +148,7 @@ class SavedTestSuite(ERP5TypeTestSuite):
def __init__(self, *args, **kw):
def __init__(self, *args, **kw):
# Use same portal id for all tests run by current instance
# Use same portal id for all tests run by current instance
# but keep it (per-run) random.
# but keep it (per-run) random.
self._portal_id = 'portal_%i' % (random.randint(0, sys.max
int
), )
self._portal_id = 'portal_%i' % (random.randint(0, sys.max
size
), )
self._setup_failed = False
self._setup_failed = False
super(SavedTestSuite, self).__init__(*args, **kw)
super(SavedTestSuite, self).__init__(*args, **kw)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment