Commit 791f2fc3 authored by Jérome Perrin's avatar Jérome Perrin

CMFActivity: don't use deprecated getCurrentNode

parent e8e5f273
...@@ -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 = ()
......
...@@ -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>
......
...@@ -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, [])
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