[CMF-checkins] CVS: CMF/CMFSetup/tests - test_actions.py:1.7 test_typeinfo.py:1.8

Yvo Schubbe y.2004_ at wcm-solutions.de
Mon Jul 19 14:12:07 EDT 2004


Update of /cvs-repository/CMF/CMFSetup/tests
In directory cvs.zope.org:/tmp/cvs-serv10833/CMFSetup/tests

Modified Files:
	test_actions.py test_typeinfo.py 
Log Message:
merged yuppie-actions-cleanup-branch:
- enforced usage of 'title' instead of 'name', 'url' instead of 'action'
- enforced boolean type of 'visible'
- refactored CMFSetup actions and type-info handling
- updated default profile


=== CMF/CMFSetup/tests/test_actions.py 1.6 => 1.7 ===
--- CMF/CMFSetup/tests/test_actions.py:1.6	Thu Jul  1 19:14:23 2004
+++ CMF/CMFSetup/tests/test_actions.py	Mon Jul 19 14:11:37 2004
@@ -109,23 +109,25 @@
                      }
                    , { 'id' : 'portal_foo'
                      , 'actions' : [ { 'id' : 'foo'
-                                     , 'name' : 'Foo'
+                                     , 'title' : 'Foo'
+                                     , 'description' : ''
                                      , 'action' : 'string:${object_url}/foo'
                                      , 'condition' : 'python:1'
-                                     , 'permission' : ''
+                                     , 'permissions' : ()
                                      , 'category' : 'dummy'
-                                     , 'visible' : 1
+                                     , 'visible' : True
                                      }
                                    ]
                      }
                    , { 'id' : 'portal_bar'
                      , 'actions' : [ { 'id' : 'bar'
-                                     , 'name' : 'Bar'
+                                     , 'title' : 'Bar'
+                                     , 'description' : ''
                                      , 'action' : 'string:${object_url}/bar'
                                      , 'condition' : 'python:0'
-                                     , 'permission' : 'Manage portal'
+                                     , 'permissions' : ('Manage portal',)
                                      , 'category' : 'dummy'
-                                     , 'visible' : 0
+                                     , 'visible' : False
                                      }
                                    ]
                      }
@@ -183,28 +185,28 @@
         self.assertEqual( len( info[ 'actions' ] ), 1 )
 
         action = info[ 'actions' ][ 0 ]
-        self.assertEqual( action[ 'action_id' ], 'foo' )
-        self.assertEqual( action[ 'name' ], 'Foo' )
+        self.assertEqual( action[ 'id' ], 'foo' )
+        self.assertEqual( action[ 'title' ], 'Foo' )
         self.assertEqual( action[ 'action' ]
                         , 'string:${object_url}/foo' )
         self.assertEqual( action[ 'condition' ], 'python:1' )
-        self.assertEqual( action[ 'permission' ], '' )
+        self.assertEqual( action[ 'permissions' ], () )
         self.assertEqual( action[ 'category' ], 'dummy' )
-        self.assertEqual( action[ 'visible' ], '1' )
+        self.assertEqual( action[ 'visible' ], True )
 
         info = info_list[ 2 ]
         self.assertEqual( info[ 'id' ], 'portal_bar' )
         self.assertEqual( len( info[ 'actions' ] ), 1 )
 
         action = info[ 'actions' ][ 0 ]
-        self.assertEqual( action[ 'action_id' ], 'bar' )
-        self.assertEqual( action[ 'name' ], 'Bar' )
+        self.assertEqual( action[ 'id' ], 'bar' )
+        self.assertEqual( action[ 'title' ], 'Bar' )
         self.assertEqual( action[ 'action' ]
                         , 'string:${object_url}/bar' )
         self.assertEqual( action[ 'condition' ], 'python:0' )
-        self.assertEqual( action[ 'permission' ], 'Manage portal' )
+        self.assertEqual( action[ 'permissions' ], ('Manage portal',) )
         self.assertEqual( action[ 'category' ], 'dummy' )
-        self.assertEqual( action[ 'visible' ], '0' )
+        self.assertEqual( action[ 'visible' ], False )
 
 
 
@@ -224,20 +226,21 @@
  <action-provider id="portal_foo">
   <action action_id="foo"
           title="Foo"
-          action_expr="string:${object_url}/foo"
+          url_expr="string:${object_url}/foo"
           condition_expr="python:1"
-          permission=""
           category="dummy"
-          visible="1" />
- </action-provider>
+          visible="True">
+  </action>
+</action-provider>
  <action-provider id="portal_bar">
   <action action_id="bar"
           title="Bar"
-          action_expr="string:${object_url}/bar"
+          url_expr="string:${object_url}/bar"
           condition_expr="python:0"
-          permission="Manage portal"
           category="dummy"
-          visible="0" />
+          visible="False">
+   <permission>Manage portal</permission>
+  </action>
  </action-provider>
 </actions-tool>
 """


=== CMF/CMFSetup/tests/test_typeinfo.py 1.7 => 1.8 ===
--- CMF/CMFSetup/tests/test_typeinfo.py:1.7	Tue Jun  8 15:00:29 2004
+++ CMF/CMFSetup/tests/test_typeinfo.py	Mon Jul 19 14:11:37 2004
@@ -439,7 +439,6 @@
    factory="addFoo"
    immediate_view="foo_view"
    filter_content_types="False"
-   allowed_content_types=""
    allow_discussion="False"
    global_allow="False" >
   <description>Foo things</description>
@@ -450,30 +449,30 @@
   <action
      action_id="view"
      title="View"
-     action_expr="string:${object_url}/foo_view"
-     condition=""
-     permissions="View"
+     url_expr="string:${object_url}/foo_view"
+     condition_expr=""
      category="object"
-     visible="True"
-     />
+     visible="True">
+   <permission>View</permission>
+  </action>
   <action
      action_id="edit"
      title="Edit"
-     action_expr="string:${object_url}/foo_edit_form"
-     condition=""
-     permissions="Modify portal content"
+     url_expr="string:${object_url}/foo_edit_form"
+     condition_expr=""
      category="object"
-     visible="True"
-     />
+     visible="True">
+   <permission>Modify portal content</permission>
+  </action>
   <action
      action_id="metadata"
      title="Metadata"
-     action_expr="string:${object_url}/metadata_edit_form"
-     condition=""
-     permissions="Modify portal content"
+     url_expr="string:${object_url}/metadata_edit_form"
+     condition_expr=""
      category="object"
-     visible="True"
-     />
+     visible="True">
+   <permission>Modify portal content</permission>
+  </action>
 </type-info>
 """
 
@@ -488,10 +487,10 @@
    permission="Add portal content"
    immediate_view="bar_view"
    filter_content_types="True"
-   allowed_content_types="foo"
    allow_discussion="True"
    global_allow="True" >
   <description>Bar things</description>
+  <allowed_content_type>foo</allowed_content_type>
   <aliases>
    <alias from="(Default)" to="bar_view" />
    <alias from="view" to="bar_view" />
@@ -499,39 +498,39 @@
   <action
      action_id="view"
      title="View"
-     action_expr="string:${object_url}/bar_view"
-     condition=""
-     permissions="View"
+     url_expr="string:${object_url}/bar_view"
+     condition_expr=""
      category="object"
-     visible="True"
-     />
+     visible="True">
+   <permission>View</permission>
+  </action>
   <action
      action_id="edit"
      title="Edit"
-     action_expr="string:${object_url}/bar_edit_form"
-     condition=""
-     permissions="Modify portal content"
+     url_expr="string:${object_url}/bar_edit_form"
+     condition_expr=""
      category="object"
-     visible="True"
-     />
+     visible="True">
+   <permission>Modify portal content</permission>
+  </action>
   <action
      action_id="contents"
      title="Contents"
-     action_expr="string:${object_url}/folder_contents"
-     condition=""
-     permissions="Access contents information"
+     url_expr="string:${object_url}/folder_contents"
+     condition_expr=""
      category="object"
-     visible="True"
-     />
+     visible="True">
+   <permission>Access contents information</permission>
+  </action>
   <action
      action_id="metadata"
      title="Metadata"
-     action_expr="string:${object_url}/metadata_edit_form"
-     condition=""
-     permissions="Modify portal content"
+     url_expr="string:${object_url}/metadata_edit_form"
+     condition_expr=""
      category="object"
-     visible="True"
-     />
+     visible="True">
+   <permission>Modify portal content</permission>
+  </action>
 </type-info>
 """
 



More information about the CMF-checkins mailing list