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
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
cc392900
Commit
cc392900
authored
Apr 21, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core_test: pylint for py3
parent
a9a4aec0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
77 deletions
+79
-77
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testAlarm.py
...TestTemplateItem/portal_components/test.erp5.testAlarm.py
+1
-1
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Catalog.py
...mplateItem/portal_components/test.erp5.testERP5Catalog.py
+4
-3
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Core.py
...tTemplateItem/portal_components/test.erp5.testERP5Core.py
+74
-73
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testAlarm.py
View file @
cc392900
...
...
@@ -113,7 +113,7 @@ class TestAlarm(AlarmTestCase):
finally
:
self
.
portal
.
portal_activities
.
manageClearActivities
(
keep
=
0
)
else
:
raise
Exception
(
'Tic did not raise though activity was supposed to fail'
)
self
.
fail
(
'Tic did not raise though activity was supposed to fail'
)
# Make the sense method succeed and leave a trace
self
.
getPortal
().
portal_skins
[
skin_folder_id
][
sense_method_id
].
ZPythonScript_edit
(
'*args,**kw'
,
'context.newActiveProcess()'
)
alarm
.
activeSense
()
...
...
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Catalog.py
View file @
cc392900
...
...
@@ -642,7 +642,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
self
.
assertEqual
([
'5'
],
folder_object_list
)
if
six
.
PY2
:
folder_object_list
=
[
x
.
getObject
().
getId
()
for
x
in
person_module
.
searchFolder
(
title
=
unicod
e
(
title
,
'utf-8'
))]
person_module
.
searchFolder
(
title
=
six
.
text_typ
e
(
title
,
'utf-8'
))]
self
.
assertEqual
([
'5'
],
folder_object_list
)
def
test_Collation
(
self
):
...
...
@@ -2167,7 +2167,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
result
=
query
(
'SELECT * FROM roles_and_users WHERE allowedRolesAndUsers LIKE "%s:%%" AND uid = %i'
%
(
line
[
'allowedRolesAndUsers'
],
uid
)
)
self
.
assertNotEqual
(
len
(
result
),
0
,
'No line found for allowedRolesAndUsers=%r and uid=%i'
%
(
line
[
'allowedRolesAndUsers'
],
uid
))
else
:
raise
Exception
(
'Malformed allowedRolesAndUsers value: %(allowedRolesAndUsers)r'
%
line
)
raise
ValueError
(
'Malformed allowedRolesAndUsers value: %(allowedRolesAndUsers)r'
%
line
)
# Check that object that 'bar' can view because of 'Author' role can *not*
# be found when searching for his other 'Whatever' role.
...
...
@@ -4067,7 +4067,8 @@ VALUES
def
doSomething
(
self
,
message_list
):
r
=
[]
for
m
in
message_list
:
m
.
result
=
r
.
append
(
m
.
object
.
getPath
())
r
.
append
(
m
.
object
.
getPath
())
m
.
result
=
None
r
.
sort
()
group_method_call_list
.
append
(
r
)
self
.
portal
.
portal_activities
.
__class__
.
doSomething
=
doSomething
...
...
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Core.py
View file @
cc392900
...
...
@@ -42,20 +42,19 @@ from Products.ERP5Type.tests.utils import DummyTranslationService
from
zExceptions
import
Unauthorized
if
1
:
# BBB
# Zope 2.12, simulate setting the globalTranslationService with
# zope.i18n utilities
import
zope.interface
import
zope.component
import
Acquisition
# Zope 2.12, simulate setting the globalTranslationService with
# zope.i18n utilities
import
zope.interface
import
zope.component
import
Acquisition
global_translation_service
=
None
global_translation_service
=
None
from
zope.i18n.interfaces
import
ITranslationDomain
,
\
from
zope.i18n.interfaces
import
ITranslationDomain
,
\
IFallbackTranslationDomainFactory
@
zope
.
interface
.
implementer
(
ITranslationDomain
)
@
zope
.
interface
.
provider
(
IFallbackTranslationDomainFactory
)
class
DummyTranslationDomainFallback
(
object
):
@
zope
.
interface
.
implementer
(
ITranslationDomain
)
@
zope
.
interface
.
provider
(
IFallbackTranslationDomainFactory
)
class
DummyTranslationDomainFallback
(
object
):
def
__init__
(
self
,
domain
):
self
.
domain
=
domain
...
...
@@ -64,7 +63,7 @@ if 1: # BBB
return
global_translation_service
.
translate
(
self
.
domain
,
msgid
,
mapping
,
*
args
,
**
kw
)
def
setGlobalTranslationService
(
translation_service
):
def
setGlobalTranslationService
(
translation_service
):
global
global_translation_service
# pylint:disable=global-statement
global_translation_service
=
translation_service
zope
.
component
.
provideUtility
(
DummyTranslationDomainFallback
,
...
...
@@ -84,7 +83,7 @@ if 1: # BBB
portal
.
_save_ui_domain
=
[
ui_domain
]
sm
.
unregisterUtility
(
provided
=
ITranslationDomain
,
name
=
'ui'
)
def
unregister_translation_domain_fallback
():
def
unregister_translation_domain_fallback
():
from
zope.component.globalregistry
import
base
base
.
unregisterUtility
(
DummyTranslationDomainFallback
)
sm
=
zope
.
component
.
getSiteManager
()
...
...
@@ -96,6 +95,7 @@ if 1: # BBB
sm
.
registerUtility
(
ui_domain
,
ITranslationDomain
,
'ui'
)
del
portal
.
_save_ui_domain
HTTP_OK
=
200
HTTP_UNAUTHORIZED
=
401
HTTP_REDIRECT
=
302
...
...
@@ -599,7 +599,8 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
# now let's simulate a site just migrated from Zope 2.8 that's being
# accessed for the first time:
from
Products.ERP5
import
ERP5Site
if
1
:
# BBB
# BBB
setSite
()
# Sites from Zope2.8 don't have a site_manager yet.
del
self
.
portal
.
_components
...
...
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