[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/container/ Added AppContainerLayer to existing ftests.

Baiju M baiju.m.mail at gmail.com
Sat Jan 20 04:54:39 EST 2007


Log message for revision 72118:
  Added AppContainerLayer to existing ftests.
  

Changed:
  U   Zope3/trunk/src/zope/app/container/browser/ftests/test_contents.py
  A   Zope3/trunk/src/zope/app/container/ftesting.zcml
  A   Zope3/trunk/src/zope/app/container/ftests/ftesting.zcml
  U   Zope3/trunk/src/zope/app/container/ftests/test_view_permissions.py
  A   Zope3/trunk/src/zope/app/container/testing.py

-=-
Modified: Zope3/trunk/src/zope/app/container/browser/ftests/test_contents.py
===================================================================
--- Zope3/trunk/src/zope/app/container/browser/ftests/test_contents.py	2007-01-20 09:39:18 UTC (rev 72117)
+++ Zope3/trunk/src/zope/app/container/browser/ftests/test_contents.py	2007-01-20 09:54:38 UTC (rev 72118)
@@ -29,6 +29,7 @@
 from zope.app.testing import ztapi
 from zope.app.testing.functional import BrowserTestCase
 from zope.app.testing.functional import FunctionalDocFileSuite
+from zope.app.container.testing import AppContainerLayer
 
 
 class IImmovable(Interface):
@@ -339,8 +340,11 @@
 
 def test_suite():
     suite = unittest.TestSuite()
+    Test.layer = AppContainerLayer
     suite.addTest(unittest.makeSuite(Test))
-    suite.addTest(FunctionalDocFileSuite("index.txt"))
+    index = FunctionalDocFileSuite("index.txt")
+    index.layer = AppContainerLayer
+    suite.addTest(index)
     return suite
 
 if __name__=='__main__':

Added: Zope3/trunk/src/zope/app/container/ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/app/container/ftesting.zcml	2007-01-20 09:39:18 UTC (rev 72117)
+++ Zope3/trunk/src/zope/app/container/ftesting.zcml	2007-01-20 09:54:38 UTC (rev 72118)
@@ -0,0 +1,57 @@
+<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.ftests" />
+  <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.app.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>


Property changes on: Zope3/trunk/src/zope/app/container/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Zope3/trunk/src/zope/app/container/ftests/ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/app/container/ftests/ftesting.zcml	2007-01-20 09:39:18 UTC (rev 72117)
+++ Zope3/trunk/src/zope/app/container/ftests/ftesting.zcml	2007-01-20 09:54:38 UTC (rev 72118)
@@ -0,0 +1,57 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   xmlns:meta="http://namespaces.zope.org/meta"
+   i18n_domain="zope"
+   >
+
+  <!-- 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.ftests" />
+  <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.app.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>


Property changes on: Zope3/trunk/src/zope/app/container/ftests/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: Zope3/trunk/src/zope/app/container/ftests/test_view_permissions.py
===================================================================
--- Zope3/trunk/src/zope/app/container/ftests/test_view_permissions.py	2007-01-20 09:39:18 UTC (rev 72117)
+++ Zope3/trunk/src/zope/app/container/ftests/test_view_permissions.py	2007-01-20 09:54:38 UTC (rev 72118)
@@ -13,7 +13,7 @@
 ##############################################################################
 """Container View Permissions Tests
 
-$Id: $
+$Id$
 """
 import unittest
 import transaction
@@ -24,8 +24,8 @@
 from zope.app.file import File
 from zope.dublincore.interfaces import IZopeDublinCore
 from zope.app.securitypolicy.interfaces import IRolePermissionManager
+from zope.app.container.testing import AppContainerLayer
 
-
 class Tests(BrowserTestCase):
 
     def test_default_view_permissions(self):
@@ -95,6 +95,7 @@
 
 def test_suite():
     suite = unittest.TestSuite()
+    Tests.layer = AppContainerLayer
     suite.addTest(unittest.makeSuite(Tests))
     return suite
 

Added: Zope3/trunk/src/zope/app/container/testing.py
===================================================================
--- Zope3/trunk/src/zope/app/container/testing.py	2007-01-20 09:39:18 UTC (rev 72117)
+++ Zope3/trunk/src/zope/app/container/testing.py	2007-01-20 09:54:38 UTC (rev 72118)
@@ -0,0 +1,7 @@
+import os
+from zope.app.testing.functional import ZCMLLayer
+
+AppContainerLayer = ZCMLLayer(
+    os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+    __name__, 'AppContainerLayer')
+


Property changes on: Zope3/trunk/src/zope/app/container/testing.py
___________________________________________________________________
Name: svn:eol-style
   + native



More information about the Zope3-Checkins mailing list