[Checkins] SVN: z3c.securitytool/trunk/ - Updated tests, test setup and demo app to run with ZTK 1.0 on Python 2.4 and Python 2.6.

Michael Howitz mh at gocept.com
Wed Oct 20 02:53:39 EDT 2010


Log message for revision 117785:
  - Updated tests, test setup and demo app to run with ZTK 1.0 on Python 2.4 and Python 2.6.
  

Changed:
  _U  z3c.securitytool/trunk/
  U   z3c.securitytool/trunk/CHANGES.txt
  U   z3c.securitytool/trunk/buildout.cfg
  U   z3c.securitytool/trunk/setup.py
  U   z3c.securitytool/trunk/src/z3c/securitytool/README.txt
  U   z3c.securitytool/trunk/src/z3c/securitytool/concordTimesPrincipals.zcml
  U   z3c.securitytool/trunk/src/z3c/securitytool/ftesting.zcml
  U   z3c.securitytool/trunk/src/z3c/securitytool/site.zcml

-=-

Property changes on: z3c.securitytool/trunk
___________________________________________________________________
Added: svn:ignore
   + .installed.cfg
bin
develop-eggs
parts


Modified: z3c.securitytool/trunk/CHANGES.txt
===================================================================
--- z3c.securitytool/trunk/CHANGES.txt	2010-10-20 01:59:02 UTC (rev 117784)
+++ z3c.securitytool/trunk/CHANGES.txt	2010-10-20 06:53:38 UTC (rev 117785)
@@ -2,7 +2,13 @@
 CHANGES
 =======
 
+Version 0.5.0 (unreleased)
+--------------------------
 
+- Updated tests, test setup and demo app to run with ZTK 1.0 on Python 2.4
+  and Python 2.6.
+
+
 Version 0.4.2 (2008-07-22)
 ---------------------------
 - Fixed issue with inheritance display on the permissionDetails page
@@ -52,7 +58,7 @@
 
 Version 0.3.5 (2008-03-02)
 --------------------------
-- Fixed issue where SecurityTool skin was only declared for the demo, 
+- Fixed issue where SecurityTool skin was only declared for the demo,
   skin is now declared in the configure.zcml.
 
 Version 0.3.4 (2008-02-26)
@@ -96,8 +102,8 @@
 - Fixed bug in permDetails
 - Updated interface and views
 - Added some more content to the demo
-  
 
+
 Version 0.2.3 (2008-01-29)
 --------------------------
 - Fixed issue where all the permissions associated with a principal
@@ -115,13 +121,13 @@
 Version 0.2.0 (2008-01-26)
 --------------------------
 - Initial release of fully functional z3c.securitytool
-  
+
 Version 0.2.1 (2008-01-26)
 --------------------------
 - Fixed bug with Principal Details page
-  
 
 
 
 
 
+

Modified: z3c.securitytool/trunk/buildout.cfg
===================================================================
--- z3c.securitytool/trunk/buildout.cfg	2010-10-20 01:59:02 UTC (rev 117784)
+++ z3c.securitytool/trunk/buildout.cfg	2010-10-20 06:53:38 UTC (rev 117785)
@@ -1,6 +1,10 @@
 [buildout]
+extends =
+   http://download.zope.org/zopetoolkit/index/1.0/ztk-versions.cfg
+   http://download.zope.org/zopetoolkit/index/1.0/zopeapp-versions.cfg
 develop = .
 parts = test coverage demo
+versions = versions
 
 [test]
 recipe = zc.recipe.testrunner

Modified: z3c.securitytool/trunk/setup.py
===================================================================
--- z3c.securitytool/trunk/setup.py	2010-10-20 01:59:02 UTC (rev 117784)
+++ z3c.securitytool/trunk/setup.py	2010-10-20 06:53:38 UTC (rev 117785)
@@ -60,9 +60,14 @@
                              'zope.app.session',
                              'zope.app.twisted',
                              'zope.app.zcmlfiles'],
-        test = ['zope.app.container', 'zope.testing',
-                'z3c.coverage', 'z3c.template',
-                'zope.app.i18n', ],
+        test = [
+            'zope.app.container',
+            'zope.testing',
+            'z3c.coverage',
+            'z3c.template',
+            'zope.app.i18n',
+            'zope.dublincore >= 3.7',
+            ],
         adding = ['zope.app.container'],
         ),
     install_requires = [
@@ -75,17 +80,17 @@
         'zope.app.zapi',
         'zope.security',
         'zope.session',
-        'zope.testing',        
+        'zope.testing',
         'zope.app.testing',
-        'zope.app.twisted',        
+        'zope.app.twisted',
         'zope.app.apidoc',
         'zope.securitypolicy',
         'zope.app.security',
         'zope.app.securitypolicy',
-        'zope.annotation',        
+        'zope.annotation',
         'zope.app.authentication',
         'zope.app.folder',
-        'zope.testbrowser',                
+        'zope.testbrowser',
         'zope.i18n',
         'zope.i18nmessageid',
         'zope.configuration',
@@ -97,6 +102,5 @@
         'z3c.layer',
         'zope.viewlet',
         ],
-    dependency_links = ['http://download.zope.org/distribution'],
     zip_safe = False,
     )

Modified: z3c.securitytool/trunk/src/z3c/securitytool/README.txt
===================================================================
--- z3c.securitytool/trunk/src/z3c/securitytool/README.txt	2010-10-20 01:59:02 UTC (rev 117784)
+++ z3c.securitytool/trunk/src/z3c/securitytool/README.txt	2010-10-20 06:53:38 UTC (rev 117785)
@@ -44,7 +44,7 @@
 
     >>> print folder1.__class__.__name__
     SecurityChecker
-    
+
     Lets introspect the object.
 
     >>> pprint(dir(folder1))
@@ -58,8 +58,8 @@
      'populateMatrix',
      'populatePermissionMatrix',
      'populateViewRoleMatrix']
-        
 
+
     To get all the security settings for particular context level the
     getPermissionSettingsForAllViews is called with a tuple of interfaces.
     All the views registered for the interfaces passed will be inspected.
@@ -76,10 +76,11 @@
 
     >>> ifaces = tuple(providedBy(root['Folder1']))
     >>> pprint(ifaces)
-    (<InterfaceClass zope.app.folder.interfaces.IFolder>,
+    (<InterfaceClass zope.site.interfaces.IFolder>,
+     <InterfaceClass zope.container.interfaces.IContentContainer>,
      <InterfaceClass persistent.interfaces.IPersistent>,
-     <InterfaceClass zope.location.interfaces.IPossibleSite>,
-     <InterfaceClass zope.app.container.interfaces.IContained>)
+     <InterfaceClass zope.location.interfaces.IContained>,
+     <InterfaceClass zope.component.interfaces.IPossibleSite>)
 
     The next step to determine security levels is the getViews function.
     `getViews` gets all the registered views for this interface. This
@@ -209,7 +210,7 @@
     Below we check to make sure the groups data structure from the user daniel
     is returned as expected. This is the data used to populate the groups
     section on the User Details page.
-    
+
     >>> pprint(matrix['groups'].keys())
     ['zope.randy']
 
@@ -249,18 +250,24 @@
     The permissions section of the matrix displays the final say on
     whether or not the user has permissions at this context level.
 
-    >>> pprint(matrix['permissions'])
-    [{'setting': PermissionSetting: Allow, 'permission': 'concord.CreateArticle'},
-     {'setting': PermissionSetting: Deny, 'permission': 'concord.ReadIssue'},
-     {'setting': PermissionSetting: Allow, 'permission': 'concord.DeleteIssue'},
-     {'setting': PermissionSetting: Deny, 'permission': 'concord.DeleteArticle'},
-     {'setting': PermissionSetting: Allow, 'permission': 'concord.CreateIssue'},
-     {'setting': PermissionSetting: Allow, 'permission': 'concord.PublishIssue'}]
+    >>> pprint(matrix['permissions'], width=1)
+    [{'permission': 'concord.CreateArticle',
+      'setting': PermissionSetting: Allow},
+     {'permission': 'concord.ReadIssue',
+      'setting': PermissionSetting: Deny},
+     {'permission': 'concord.DeleteIssue',
+      'setting': PermissionSetting: Allow},
+     {'permission': 'concord.DeleteArticle',
+      'setting': PermissionSetting: Deny},
+     {'permission': 'concord.CreateIssue',
+      'setting': PermissionSetting: Allow},
+     {'permission': 'concord.PublishIssue',
+      'setting': PermissionSetting: Allow}]
 
     The roleTree structure is used to display the roles attained at
     each level of traversal. The roleTree is stored as a list so to
-    consistently test the data properly we will create a dictionary 
-    out of it and is similar in function to the permissionTree.    
+    consistently test the data properly we will create a dictionary
+    out of it and is similar in function to the permissionTree.
 
     >>> tmpDict = {}
     >>> keys = matrix['roleTree']
@@ -273,7 +280,7 @@
      'roles': [{'principal': 'zope.daniel',
                 'role': 'zope.Writer',
                 'setting': PermissionSetting: Allow}]}
-    
+
     >>> pprint(tmpDict['Folder1_2'])
     {'name': None,
      'parentList': [u'Folder1', 'Root Folder'],
@@ -291,11 +298,15 @@
     The roles section of the matrix displays the final say on whether or
     not the user has the role assigned at this context level.
 
-    >>> pprint(matrix['roles'])
-    {'zope.Janitor': [{'setting': 'Allow', 'permission': 'concord.ReadIssue'}],
-     'zope.Writer':  [{'setting': 'Allow', 'permission': 'concord.DeleteArticle'},
-                      {'setting': 'Allow', 'permission': 'concord.CreateArticle'},
-                      {'setting': 'Allow', 'permission': 'concord.ReadIssue'}]}
+    >>> pprint(matrix['roles'], width=1)
+    {'zope.Janitor': [{'permission': 'concord.ReadIssue',
+                       'setting': 'Allow'}],
+     'zope.Writer': [{'permission': 'concord.DeleteArticle',
+                      'setting': 'Allow'},
+                     {'permission': 'concord.CreateArticle',
+                      'setting': 'Allow'},
+                     {'permission': 'concord.ReadIssue',
+                      'setting': 'Allow'}]}
 
 
 Now lets see what the permission details returns
@@ -457,10 +468,10 @@
     This is the principal detail page, you can get to by clicking on the
     principals name at the top of the form
 
-    >>> manager.open(server + 
+    >>> manager.open(server +
     ...              '/@@principalDetails.html?principal=zope.daniel')
 
-    >>> manager.open(server + 
+    >>> manager.open(server +
     ...              '/Folder1/Folder2/Folder3/'
     ...              '@@principalDetails.html?principal=zope.daniel')
 
@@ -488,21 +499,21 @@
     Traceback (most recent call last):
     ...
     PrincipalLookupError: no user specified
- 
 
+
     And now we will test it without the view name
 
     >>> manager.open(server + '/@@permissionDetails.html?'
     ...                        'principal=zope.daniel')
 
     And now with a view name that does not exist
-  
+
     >>> manager.open(server + '/@@permissionDetails.html?'
     ...              'principal=zope.daniel&view=garbage')
-  
+
     Lets also test with a different context level
-  
-    >>> manager.open(server + 
+
+    >>> manager.open(server +
     ...              '/Folder1/Folder2/Folder3/'
     ...              '@@permissionDetails.html'
     ...              '?principal=zope.daniel&view=ReadIssue.html')

Modified: z3c.securitytool/trunk/src/z3c/securitytool/concordTimesPrincipals.zcml
===================================================================
--- z3c.securitytool/trunk/src/z3c/securitytool/concordTimesPrincipals.zcml	2010-10-20 01:59:02 UTC (rev 117784)
+++ z3c.securitytool/trunk/src/z3c/securitytool/concordTimesPrincipals.zcml	2010-10-20 06:53:38 UTC (rev 117785)
@@ -137,7 +137,7 @@
       <role id="zope.Manager" title="Manager" />
 
 
-      <!-- And the Boiler Plate --> 
+      <!-- And the Boiler Plate -->
 
       <grant
         role="zope.Manager"
@@ -153,7 +153,7 @@
 
       <grant permission="zope.View"
                       role="zope.Anonymous" />
-      <grant permission="zope.app.dublincore.view"
+      <grant permission="zope.dublincore.view"
                       role="zope.Anonymous" />
 
 </configure>

Modified: z3c.securitytool/trunk/src/z3c/securitytool/ftesting.zcml
===================================================================
--- z3c.securitytool/trunk/src/z3c/securitytool/ftesting.zcml	2010-10-20 01:59:02 UTC (rev 117784)
+++ z3c.securitytool/trunk/src/z3c/securitytool/ftesting.zcml	2010-10-20 06:53:38 UTC (rev 117785)
@@ -8,7 +8,7 @@
   <!-- This file is the equivalent of site.zcml and it is -->
   <!-- used for functional testing setup -->
 
-  <include package="zope.app.securitypolicy" file="meta.zcml" />
+  <include package="zope.securitypolicy" file="meta.zcml" />
 
   <include package="zope.app.zcmlfiles" />
   <include package="zope.app.authentication" />
@@ -16,10 +16,9 @@
   <!--include package="zope.app.keyreference" /-->
   <!--include package="zope.app.intid" /-->
   <include package="zope.app.publisher.browser" />
+  <include package="zope.login" />
 
 
-
-
   <securityPolicy
       component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
 
@@ -27,7 +26,8 @@
   <role id="zope.Manager" title="Site Manager" />
 
   <grantAll role="zope.Manager" />
-  <include package="zope.app.securitypolicy.tests" file="functional.zcml" />
+  <include package="zope.app.securitypolicy.browser.tests"
+           file="functional.zcml" />
 
   <!-- Principal that tests generally run as -->
   <principal

Modified: z3c.securitytool/trunk/src/z3c/securitytool/site.zcml
===================================================================
--- z3c.securitytool/trunk/src/z3c/securitytool/site.zcml	2010-10-20 01:59:02 UTC (rev 117784)
+++ z3c.securitytool/trunk/src/z3c/securitytool/site.zcml	2010-10-20 06:53:38 UTC (rev 117785)
@@ -7,10 +7,11 @@
 
   <include package="zope.app.authentication" />
   <include package="zope.app.securitypolicy" />
-  <include package="zope.app.securitypolicy" file="meta.zcml" />
+  <include package="zope.securitypolicy" file="meta.zcml" />
 
   <include package="zope.app.session" />
   <include package="zope.app.twisted" />
+  <include package="zope.login" />
 
   <securityPolicy
     component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />



More information about the checkins mailing list