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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lukas Niegsch
erp5
Commits
791f2fc3
Commit
791f2fc3
authored
Jun 01, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CMFActivity: don't use deprecated getCurrentNode
parent
e8e5f273
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
+12
-9
product/CMFActivity/ActivityTool.py
product/CMFActivity/ActivityTool.py
+1
-1
product/CMFActivity/dtml/manageLoadBalancing.dtml
product/CMFActivity/dtml/manageLoadBalancing.dtml
+2
-2
product/CMFActivity/tests/testCMFActivity.py
product/CMFActivity/tests/testCMFActivity.py
+9
-6
No files found.
product/CMFActivity/ActivityTool.py
View file @
791f2fc3
...
@@ -653,7 +653,7 @@ class ActivityTool (BaseTool):
...
@@ -653,7 +653,7 @@ class ActivityTool (BaseTool):
manage_overview
=
DTMLFile
(
'dtml/explainActivityTool'
,
globals
()
)
manage_overview
=
DTMLFile
(
'dtml/explainActivityTool'
,
globals
()
)
security
.
declareProtected
(
CMFCorePermissions
.
ManagePortal
,
'manageLoadBalancing'
)
security
.
declareProtected
(
CMFCorePermissions
.
ManagePortal
,
'manageLoadBalancing'
)
manageLoadBalancing
=
DTMLFile
(
'dtml/manageLoadBalancing'
,
globals
()
)
manageLoadBalancing
=
DTMLFile
(
'dtml/manageLoadBalancing'
,
globals
()
,
_getCurrentNode
=
getCurrentNode
)
distributingNode
=
''
distributingNode
=
''
_nodes
=
()
_nodes
=
()
...
...
product/CMFActivity/dtml/manageLoadBalancing.dtml
View file @
791f2fc3
...
@@ -82,8 +82,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
...
@@ -82,8 +82,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td>Current node is <b><dtml-var getCurrentNode></b></td>
<td>Current node is <b><dtml-var
_
getCurrentNode></b></td>
<dtml-if expr="getCurrentNode() not in getNodeList()">
<dtml-if expr="
_
getCurrentNode() not in getNodeList()">
<td align="left" valign="top" colspan=2>
<td align="left" valign="top" colspan=2>
<p style="color: #F00"><b>Warning: Current node is not known to distribution system.</b></p>
<p style="color: #F00"><b>Warning: Current node is not known to distribution system.</b></p>
<p>
<p>
...
...
product/CMFActivity/tests/testCMFActivity.py
View file @
791f2fc3
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
##############################################################################
##############################################################################
import
inspect
import
inspect
import
unittest
import
warnings
from
functools
import
wraps
from
functools
import
wraps
from
itertools
import
product
from
itertools
import
product
from
Products.ERP5Type.tests.utils
import
LogInterceptor
from
Products.ERP5Type.tests.utils
import
LogInterceptor
...
@@ -2656,8 +2656,11 @@ return [x.getObject() for x in context.portal_catalog(limit=100)]
...
@@ -2656,8 +2656,11 @@ return [x.getObject() for x in context.portal_catalog(limit=100)]
[
message
],
[
message
],
)
)
def
test_suite
():
def
test_zmi_views
(
self
):
suite
=
unittest
.
TestSuite
()
# we can render ZMI view without errors or warnings
suite
.
addTest
(
unittest
.
makeSuite
(
TestCMFActivity
))
with
warnings
.
catch_warnings
(
record
=
True
)
as
catched_warnings
:
return
suite
self
.
portal
.
portal_activities
.
manage_overview
()
self
.
portal
.
portal_activities
.
manageActivities
()
self
.
portal
.
portal_activities
.
manageActivitiesAdvanced
()
self
.
portal
.
portal_activities
.
manageLoadBalancing
()
self
.
assertEqual
(
catched_warnings
,
[])
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