[Checkins] SVN: zope.container/trunk/src/zope/container/ remove browser subpackage
Wolfgang Schnerring
wosc at wosc.de
Wed Jan 28 10:56:16 EST 2009
Log message for revision 95340:
remove browser subpackage
Changed:
D zope.container/trunk/src/zope/container/browser/
D zope.container/trunk/src/zope/container/ftesting.zcml
D zope.container/trunk/src/zope/container/tests/test_view_permissions.py
-=-
Deleted: zope.container/trunk/src/zope/container/ftesting.zcml
===================================================================
--- zope.container/trunk/src/zope/container/ftesting.zcml 2009-01-28 15:55:34 UTC (rev 95339)
+++ zope.container/trunk/src/zope/container/ftesting.zcml 2009-01-28 15:56:15 UTC (rev 95340)
@@ -1,57 +0,0 @@
-<configure
- xmlns="http://namespaces.zope.org/zope"
- i18n_domain="zope"
- package="zope.app.container"
- >
-
- <!-- This file is the equivalent of site.zcml and it is -->
- <!-- used for functional testing setup -->
-
- <include package="zope.app.zcmlfiles" />
- <include package="zope.app.container.browser.tests" />
- <include package="zope.app.file"/>
- <include package="zope.app.authentication" />
-
- <include package="zope.app.securitypolicy" file="meta.zcml" />
- <include package="zope.app.securitypolicy.tests" file="functional.zcml" />
- <include package="zope.app.securitypolicy" />
-
- <securityPolicy
- component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
-
- <role id="zope.Anonymous" title="Everybody"
- description="All users have this role implicitly" />
- <role id="zope.Manager" title="Site Manager" />
-
- <!-- Replace the following directive if you don't want public access -->
- <grant permission="zope.View"
- role="zope.Anonymous" />
- <grant permission="zope.app.dublincore.view"
- role="zope.Anonymous" />
-
- <grantAll role="zope.Manager" />
-
- <!-- Principals -->
-
- <unauthenticatedPrincipal
- id="zope.anybody"
- title="Unauthenticated User" />
-
- <!-- Principal that tests generally run as -->
- <principal
- id="zope.mgr"
- title="Manager"
- login="mgr"
- password="mgrpw" />
-
- <!-- Bootstrap principal used to make local grant to the principal above -->
- <principal
- id="zope.globalmgr"
- title="Manager"
- login="globalmgr"
- password="globalmgrpw" />
-
- <grant role="zope.Manager" principal="zope.globalmgr" />
-
-
-</configure>
Deleted: zope.container/trunk/src/zope/container/tests/test_view_permissions.py
===================================================================
--- zope.container/trunk/src/zope/container/tests/test_view_permissions.py 2009-01-28 15:55:34 UTC (rev 95339)
+++ zope.container/trunk/src/zope/container/tests/test_view_permissions.py 2009-01-28 15:56:15 UTC (rev 95340)
@@ -1,103 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2004 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Container View Permissions Tests
-
-$Id$
-"""
-import unittest
-import transaction
-
-from zope.security.interfaces import Unauthorized
-
-from zope.app.testing.functional import BrowserTestCase
-from zope.app.file import File
-from zope.dublincore.interfaces import IZopeDublinCore
-from zope.securitypolicy.interfaces import IRolePermissionManager
-from zope.app.container.testing import AppContainerLayer
-
-class Tests(BrowserTestCase):
-
- def test_default_view_permissions(self):
- """Tests the default view permissions.
-
- See zope/app/securitypolicy/configure.zcml for the grants of
- zope.View and zope.app.dublincore.view to zope.Anonymous. These
- ensure that, by default, anonymous users can view container contents.
- """
- # add an item that can be viewed from the root folder
- file = File()
- self.getRootFolder()['file'] = file
- IZopeDublinCore(file).title = u'My File'
- transaction.commit()
-
- response = self.publish('/')
- self.assertEquals(response.getStatus(), 200)
- body = response.getBody()
-
- # confirm we can see the file name
- self.assert_(body.find('<a href="file">file</a>') != -1)
-
- # confirm we can see the metadata title
- self.assert_(body.find('<td><span>My File</span></td>') != -1)
-
- def test_deny_view(self):
- """Tests the denial of view permissions to anonymous.
-
- This test uses the ZMI interface to deny anonymous zope.View permission
- to the root folder.
- """
- # deny zope.View to zope.Anonymous
- prm = IRolePermissionManager(self.getRootFolder())
- prm.denyPermissionToRole('zope.View', 'zope.Anonymous')
- transaction.commit()
-
- # confirm Unauthorized when viewing root folder
- self.assertRaises(Unauthorized, self.publish, '/')
-
- def test_deny_dublincore_view(self):
- """Tests the denial of dublincore view permissions to anonymous.
-
- Users who can view a folder contents page but cannot view dublin core
- should still be able to see the folder items' names, but not their
- title, modified, and created info.
- """
- # add an item that can be viewed from the root folder
- file = File()
- self.getRootFolder()['file'] = file
- IZopeDublinCore(file).title = u'My File'
-
- # deny zope.app.dublincore.view to zope.Anonymous
- prm = IRolePermissionManager(self.getRootFolder())
- prm.denyPermissionToRole('zope.app.dublincore.view', 'zope.Anonymous')
- transaction.commit()
-
- response = self.publish('/')
- self.assertEquals(response.getStatus(), 200)
- body = response.getBody()
-
- # confirm we can see the file name
- self.assert_(body.find('<a href="file">file</a>') != -1)
-
- # confirm we *cannot* see the metadata title
- self.assert_(body.find('My File') == -1)
-
-
-def test_suite():
- suite = unittest.TestSuite()
- Tests.layer = AppContainerLayer
- suite.addTest(unittest.makeSuite(Tests))
- return suite
-
-if __name__=='__main__':
- unittest.main(defaultTest='test_suite')
More information about the Checkins
mailing list