[Checkins] SVN: Zope3/trunk/src/zope/app/ Added I18nFileLayer, DebugSkinLayer, AppExceptionLayer, BostonLayer,

Baiju M baiju.m.mail at gmail.com
Thu Feb 8 22:25:40 EST 2007


Log message for revision 72477:
  Added I18nFileLayer, DebugSkinLayer, AppExceptionLayer, BostonLayer,
  AppDavLayer and AppAuthenticationLayer.
  

Changed:
  U   Zope3/trunk/src/zope/app/authentication/browser/ftests.py
  A   Zope3/trunk/src/zope/app/authentication/ftesting.zcml
  A   Zope3/trunk/src/zope/app/authentication/testing.py
  U   Zope3/trunk/src/zope/app/boston/browser/ftests.py
  A   Zope3/trunk/src/zope/app/boston/ftesting.zcml
  U   Zope3/trunk/src/zope/app/boston/ftests.py
  A   Zope3/trunk/src/zope/app/boston/testing.py
  A   Zope3/trunk/src/zope/app/dav/ftesting.zcml
  U   Zope3/trunk/src/zope/app/dav/ftests/test_mkcol.py
  U   Zope3/trunk/src/zope/app/dav/ftests/test_propfind.py
  U   Zope3/trunk/src/zope/app/dav/ftests/test_proppatch.py
  A   Zope3/trunk/src/zope/app/dav/testing.py
  A   Zope3/trunk/src/zope/app/debugskin/ftesting.zcml
  U   Zope3/trunk/src/zope/app/debugskin/ftests.py
  A   Zope3/trunk/src/zope/app/debugskin/testing.py
  U   Zope3/trunk/src/zope/app/exception/browser/ftests.py
  A   Zope3/trunk/src/zope/app/exception/ftesting.zcml
  A   Zope3/trunk/src/zope/app/exception/testing.py
  U   Zope3/trunk/src/zope/app/i18nfile/browser/ftests.py
  A   Zope3/trunk/src/zope/app/i18nfile/ftesting.zcml
  A   Zope3/trunk/src/zope/app/i18nfile/testing.py

-=-
Modified: Zope3/trunk/src/zope/app/authentication/browser/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/authentication/browser/ftests.py	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/authentication/browser/ftests.py	2007-02-09 03:25:38 UTC (rev 72477)
@@ -27,6 +27,7 @@
 from zope.app.authentication.principalfolder import PrincipalFolder
 from zope.app.authentication.principalfolder import Principal
 from zope.app.authentication.principalfolder import IInternalPrincipal
+from zope.app.authentication.testing import AppAuthenticationLayer
 
 class FunkTest(functional.BrowserTestCase):
 
@@ -110,15 +111,29 @@
 
 
 def test_suite():
+    FunkTest.layer = AppAuthenticationLayer
+    principalfolder = functional.FunctionalDocFileSuite('principalfolder.txt')
+    principalfolder.layer = AppAuthenticationLayer
+    groupfolder = functional.FunctionalDocFileSuite('groupfolder.txt')
+    groupfolder.layer = AppAuthenticationLayer
+    pau_prefix_and_searching = functional.FunctionalDocFileSuite(
+        'pau_prefix_and_searching.txt')
+    pau_prefix_and_searching.layer = AppAuthenticationLayer
+    group_searching_with_empty_string = functional.FunctionalDocFileSuite(
+        'group_searching_with_empty_string.txt')
+    group_searching_with_empty_string.layer = AppAuthenticationLayer
+    special_groups = functional.FunctionalDocFileSuite('special-groups.txt')
+    special_groups.layer = AppAuthenticationLayer
+    issue663 = functional.FunctionalDocFileSuite('issue663.txt')
+    issue663.layer = AppAuthenticationLayer
     return unittest.TestSuite((
-        functional.FunctionalDocFileSuite('principalfolder.txt'),
-        functional.FunctionalDocFileSuite('groupfolder.txt'),
-        functional.FunctionalDocFileSuite('pau_prefix_and_searching.txt'),
-        functional.FunctionalDocFileSuite(
-            'group_searching_with_empty_string.txt'),
-        functional.FunctionalDocFileSuite('special-groups.txt'),
+        principalfolder,
+        groupfolder,
+        pau_prefix_and_searching,
+        group_searching_with_empty_string,
+        special_groups,
         unittest.makeSuite(FunkTest),
-        functional.FunctionalDocFileSuite('issue663.txt'),
+        issue663,
         ))
 
 if __name__ == '__main__':

Added: Zope3/trunk/src/zope/app/authentication/ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/app/authentication/ftesting.zcml	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/authentication/ftesting.zcml	2007-02-09 03:25:38 UTC (rev 72477)
@@ -0,0 +1,70 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   i18n_domain="zope"
+   package="zope.app.authentication"
+   >
+
+  <!-- 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.app.zcmlfiles" />
+  <include package="zope.formlib" />
+  <include package="zope.app.authentication" />
+  <include package="zope.app.session" />
+  <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" />
+
+  <grantAll role="zope.Manager" />
+
+  <include package="zope.app.securitypolicy.tests" file="functional.zcml" />
+
+  <!-- Principals -->
+
+  <unauthenticatedPrincipal
+      id="zope.anybody"
+      title="Unauthenticated User" />
+
+  <unauthenticatedGroup
+    id="zope.Anybody"
+    title="Unauthenticated Users"
+    />
+
+  <authenticatedGroup
+    id="zope.Authenticated"
+    title="Authenticated Users"
+    />
+
+  <everybodyGroup
+    id="zope.Everybody"
+    title="All Users"
+    />
+
+  <!-- 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/authentication/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Zope3/trunk/src/zope/app/authentication/testing.py
===================================================================
--- Zope3/trunk/src/zope/app/authentication/testing.py	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/authentication/testing.py	2007-02-09 03:25:38 UTC (rev 72477)
@@ -0,0 +1,26 @@
+##############################################################################
+#
+# Copyright (c) 2007 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.
+#
+##############################################################################
+"""zope.app.authentication common test related classes/functions/objects.
+
+$Id$
+"""
+
+__docformat__ = "reStructuredText"
+
+import os
+from zope.app.testing.functional import ZCMLLayer
+
+AppAuthenticationLayer = ZCMLLayer(
+    os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+    __name__, 'AppAuthenticationLayer', allow_teardown=True)


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

Modified: Zope3/trunk/src/zope/app/boston/browser/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/boston/browser/ftests.py	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/boston/browser/ftests.py	2007-02-09 03:25:38 UTC (rev 72477)
@@ -19,6 +19,7 @@
 import unittest
 
 from zope.app.testing.functional import BrowserTestCase
+from zope.app.boston.testing import BostonLayer
 
 class TestBostonSkin(BrowserTestCase):
 
@@ -93,6 +94,7 @@
 
 def test_suite():
     suite = unittest.TestSuite()
+    TestBostonSkin.layer = BostonLayer
     suite.addTest(unittest.makeSuite(TestBostonSkin))
     return suite
 

Added: Zope3/trunk/src/zope/app/boston/ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/app/boston/ftesting.zcml	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/boston/ftesting.zcml	2007-02-09 03:25:38 UTC (rev 72477)
@@ -0,0 +1,47 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   i18n_domain="zope"
+   package="zope.app.boston"
+   >
+
+  <!-- This file is the equivalent of site.zcml and it is -->
+  <!-- used for functional testing setup -->
+
+  <include package="zope.app.onlinehelp" file="meta.zcml"/>
+  <include package="zope.app.securitypolicy" file="meta.zcml" />
+  <include package="zope.viewlet" file="meta.zcml" />
+
+  <include package="zope.app.zcmlfiles" />
+  <include package="zope.app.onlinehelp"/>
+  <include package="zope.app.authentication" />
+  <include package="zope.contentprovider" />
+  <include package="zope.app.boston" />
+
+  <include package="zope.app.securitypolicy" />
+
+  <securityPolicy
+    component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+
+  <role id="zope.Manager" title="Site Manager" />
+
+  <grantAll role="zope.Manager" />
+
+  <include package="zope.app.securitypolicy.tests" file="functional.zcml" />
+
+  <!-- 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/boston/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: Zope3/trunk/src/zope/app/boston/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/boston/ftests.py	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/boston/ftests.py	2007-02-09 03:25:38 UTC (rev 72477)
@@ -19,14 +19,16 @@
 
 from zope.testing import doctest
 from zope.app.testing.functional import FunctionalDocFileSuite
+from zope.app.boston.testing import BostonLayer
 
-
 def test_suite():
+    boston_doctest = FunctionalDocFileSuite(
+        "README.txt",
+        optionflags=doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE)
+    boston_doctest.layer = BostonLayer
     return unittest.TestSuite((
-        FunctionalDocFileSuite(
-            "README.txt",
-            optionflags=doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE),
+        boston_doctest,
         ))
 
 if __name__ == '__main__':
-    unittest.main(defaultTest='test_suite')
\ No newline at end of file
+    unittest.main(defaultTest='test_suite')

Added: Zope3/trunk/src/zope/app/boston/testing.py
===================================================================
--- Zope3/trunk/src/zope/app/boston/testing.py	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/boston/testing.py	2007-02-09 03:25:38 UTC (rev 72477)
@@ -0,0 +1,26 @@
+##############################################################################
+#
+# Copyright (c) 2007 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.
+#
+##############################################################################
+"""zope.app.boston common test related classes/functions/objects.
+
+$Id$
+"""
+
+__docformat__ = "reStructuredText"
+
+import os
+from zope.app.testing.functional import ZCMLLayer
+
+BostonLayer = ZCMLLayer(
+    os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+    __name__, 'BostonLayer', allow_teardown=True)


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

Added: Zope3/trunk/src/zope/app/dav/ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/app/dav/ftesting.zcml	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/dav/ftesting.zcml	2007-02-09 03:25:38 UTC (rev 72477)
@@ -0,0 +1,43 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   i18n_domain="zope"
+   package="zope.app.dav"
+   >
+
+  <!-- This file is the equivalent of site.zcml and it is -->
+  <!-- used for functional testing setup -->
+
+  <include package="zope.app.dav" file="meta.zcml"/>
+  <include package="zope.app.securitypolicy" file="meta.zcml" />
+
+  <include package="zope.app.zcmlfiles" />
+  <include package="zope.app.authentication" />
+  <include package="zope.app.securitypolicy" />
+  <include package="zope.app.dav"/>
+
+  <securityPolicy
+    component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+
+  <role id="zope.Manager" title="Site Manager" />
+
+  <grantAll role="zope.Manager" />
+
+  <include package="zope.app.securitypolicy.tests" file="functional.zcml" />
+
+  <!-- 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/dav/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: Zope3/trunk/src/zope/app/dav/ftests/test_mkcol.py
===================================================================
--- Zope3/trunk/src/zope/app/dav/ftests/test_mkcol.py	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/dav/ftests/test_mkcol.py	2007-02-09 03:25:38 UTC (rev 72477)
@@ -19,6 +19,7 @@
 
 from zope.app.dav.ftests.dav import DAVTestCase
 import transaction
+from zope.app.dav.testing import AppDavLayer
 
 class TestMKCOL(DAVTestCase):
 
@@ -61,6 +62,7 @@
 
 def test_suite():
     suite = unittest.TestSuite()
+    TestMKCOL.layer = AppDavLayer
     suite.addTest(unittest.makeSuite(TestMKCOL))
     return suite
 

Modified: Zope3/trunk/src/zope/app/dav/ftests/test_propfind.py
===================================================================
--- Zope3/trunk/src/zope/app/dav/ftests/test_propfind.py	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/dav/ftests/test_propfind.py	2007-02-09 03:25:38 UTC (rev 72477)
@@ -24,6 +24,7 @@
 
 from zope.app.dav.ftests.dav import DAVTestCase
 from zope.app.dav.opaquenamespaces import IDAVOpaqueNamespaces
+from zope.app.dav.testing import AppDavLayer
 
 class TestPROPFIND(DAVTestCase):
 
@@ -101,6 +102,7 @@
 
 def test_suite():
     suite = unittest.TestSuite()
+    TestPROPFIND.layer = AppDavLayer
     suite.addTest(unittest.makeSuite(TestPROPFIND))
     return suite
 

Modified: Zope3/trunk/src/zope/app/dav/ftests/test_proppatch.py
===================================================================
--- Zope3/trunk/src/zope/app/dav/ftests/test_proppatch.py	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/dav/ftests/test_proppatch.py	2007-02-09 03:25:38 UTC (rev 72477)
@@ -24,6 +24,7 @@
 
 from zope.app.dav.ftests.dav import DAVTestCase
 from zope.app.dav.opaquenamespaces import IDAVOpaqueNamespaces
+from zope.app.dav.testing import AppDavLayer
 
 class TestPROPPATCH(DAVTestCase):
 
@@ -158,6 +159,7 @@
 
 def test_suite():
     suite = unittest.TestSuite()
+    TestPROPPATCH.layer = AppDavLayer
     suite.addTest(unittest.makeSuite(TestPROPPATCH))
     return suite
 

Added: Zope3/trunk/src/zope/app/dav/testing.py
===================================================================
--- Zope3/trunk/src/zope/app/dav/testing.py	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/dav/testing.py	2007-02-09 03:25:38 UTC (rev 72477)
@@ -0,0 +1,26 @@
+##############################################################################
+#
+# Copyright (c) 2007 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.
+#
+##############################################################################
+"""zope.app.dav common test related classes/functions/objects.
+
+$Id$
+"""
+
+__docformat__ = "reStructuredText"
+
+import os
+from zope.app.testing.functional import ZCMLLayer
+
+AppDavLayer = ZCMLLayer(
+    os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+    __name__, 'AppDavLayer', allow_teardown=True)


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

Added: Zope3/trunk/src/zope/app/debugskin/ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/app/debugskin/ftesting.zcml	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/debugskin/ftesting.zcml	2007-02-09 03:25:38 UTC (rev 72477)
@@ -0,0 +1,46 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   i18n_domain="zope"
+   package="zope.app.debugskin"
+   >
+
+  <!-- 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.app.zcmlfiles" />
+  <include package="zope.app.authentication" />
+  <include package="zope.app.securitypolicy" />
+  <include package="zope.app.debugskin"/>
+
+  <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" />
+
+  <grantAll role="zope.Manager" />
+
+  <!-- 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/debugskin/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: Zope3/trunk/src/zope/app/debugskin/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/debugskin/ftests.py	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/debugskin/ftests.py	2007-02-09 03:25:38 UTC (rev 72477)
@@ -13,10 +13,11 @@
 ##############################################################################
 """Functional Tests for Code Documentation Module.
 
-$Id: ftests.py 29309 2005-02-26 14:16:04Z srichter $
+$Id$
 """
 import unittest
 from zope.app.testing.functional import BrowserTestCase
+from zope.app.debugskin.testing import DebugSkinLayer
 
 class DebugSkinTests(BrowserTestCase):
 
@@ -33,6 +34,7 @@
                                  basic='mgr:mgrpw')
 
 def test_suite():
+    DebugSkinTests.layer = DebugSkinLayer
     return unittest.TestSuite((
         unittest.makeSuite(DebugSkinTests),
         ))

Added: Zope3/trunk/src/zope/app/debugskin/testing.py
===================================================================
--- Zope3/trunk/src/zope/app/debugskin/testing.py	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/debugskin/testing.py	2007-02-09 03:25:38 UTC (rev 72477)
@@ -0,0 +1,26 @@
+##############################################################################
+#
+# Copyright (c) 2007 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.
+#
+##############################################################################
+"""zope.app.debugskin common test related classes/functions/objects.
+
+$Id$
+"""
+
+__docformat__ = "reStructuredText"
+
+import os
+from zope.app.testing.functional import ZCMLLayer
+
+DebugSkinLayer = ZCMLLayer(
+    os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+    __name__, 'DebugSkinLayer', allow_teardown=True)


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

Modified: Zope3/trunk/src/zope/app/exception/browser/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/exception/browser/ftests.py	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/exception/browser/ftests.py	2007-02-09 03:25:38 UTC (rev 72477)
@@ -13,11 +13,12 @@
 ##############################################################################
 """Functional tests for NotFoundError
 
-$Id: ftests.py 25177 2004-06-02 13:17:31Z jim $
+$Id$
 """
 import unittest
 from zope.app.testing import functional
 from zope.component.interfaces import ComponentLookupError
+from zope.app.exception.testing import AppExceptionLayer
 
 class RaiseComponentLookupError(object):
 
@@ -37,9 +38,12 @@
 
 
 def test_suite():
+    TestComponentLookupError.layer = AppExceptionLayer
+    systemerror = functional.FunctionalDocFileSuite('systemerror.txt')
+    systemerror.layer = AppExceptionLayer
     return unittest.TestSuite((
         unittest.makeSuite(TestComponentLookupError),
-        functional.FunctionalDocFileSuite('systemerror.txt'),
+        systemerror,
         ))
 
 if __name__ == '__main__':

Added: Zope3/trunk/src/zope/app/exception/ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/app/exception/ftesting.zcml	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/exception/ftesting.zcml	2007-02-09 03:25:38 UTC (rev 72477)
@@ -0,0 +1,62 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   xmlns:browser="http://namespaces.zope.org/browser"
+   i18n_domain="zope"
+   package="zope.app.exception"
+   >
+
+  <!-- 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.app.zcmlfiles" />
+  <include package="zope.app.authentication" />
+  <include package="zope.app.zptpage"/>
+  <include package="zope.app.securitypolicy" />
+
+  <browser:page
+      for="zope.app.folder.interfaces.IFolder"
+      name="componentlookuperror.html"
+      class="zope.app.exception.browser.ftests.RaiseComponentLookupError"
+      permission="zope.Public"
+      />
+
+  <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" />
+
+  <grantAll role="zope.Manager" />
+
+  <include package="zope.app.securitypolicy.tests" file="functional.zcml" />
+
+  <!-- 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/exception/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Zope3/trunk/src/zope/app/exception/testing.py
===================================================================
--- Zope3/trunk/src/zope/app/exception/testing.py	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/exception/testing.py	2007-02-09 03:25:38 UTC (rev 72477)
@@ -0,0 +1,26 @@
+##############################################################################
+#
+# Copyright (c) 2007 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.
+#
+##############################################################################
+"""zope.app.exception common test related classes/functions/objects.
+
+$Id$
+"""
+
+__docformat__ = "reStructuredText"
+
+import os
+from zope.app.testing.functional import ZCMLLayer
+
+AppExceptionLayer = ZCMLLayer(
+    os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+    __name__, 'AppExceptionLayer', allow_teardown=True)


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

Modified: Zope3/trunk/src/zope/app/i18nfile/browser/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/i18nfile/browser/ftests.py	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/i18nfile/browser/ftests.py	2007-02-09 03:25:38 UTC (rev 72477)
@@ -19,10 +19,14 @@
 
 import unittest
 from zope.app.testing.functional import FunctionalDocFileSuite
+from zope.app.i18nfile.testing import I18nFileLayer
 
-
 def test_suite():
     suite = unittest.TestSuite()
-    suite.addTest(FunctionalDocFileSuite("i18nfile.txt"))
-    suite.addTest(FunctionalDocFileSuite("i18nimage.txt"))
+    i18nfile = FunctionalDocFileSuite("i18nfile.txt")
+    i18nfile.layer = I18nFileLayer
+    suite.addTest(i18nfile)
+    i18nimage = FunctionalDocFileSuite("i18nimage.txt")
+    i18nimage.layer = I18nFileLayer
+    suite.addTest(i18nimage)
     return suite

Added: Zope3/trunk/src/zope/app/i18nfile/ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/app/i18nfile/ftesting.zcml	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/i18nfile/ftesting.zcml	2007-02-09 03:25:38 UTC (rev 72477)
@@ -0,0 +1,49 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   i18n_domain="zope"
+   package="zope.app.i18nfile"
+   >
+
+  <!-- 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.app.zcmlfiles" />
+  <include package="zope.app.file"/>
+  <include package="zope.app.i18nfile"/>
+  <include package="zope.app.authentication" />
+  <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" />
+
+  <grantAll role="zope.Manager" />
+
+  <include package="zope.app.securitypolicy.tests" file="functional.zcml" />
+
+  <!-- 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/i18nfile/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Zope3/trunk/src/zope/app/i18nfile/testing.py
===================================================================
--- Zope3/trunk/src/zope/app/i18nfile/testing.py	2007-02-08 21:31:44 UTC (rev 72476)
+++ Zope3/trunk/src/zope/app/i18nfile/testing.py	2007-02-09 03:25:38 UTC (rev 72477)
@@ -0,0 +1,26 @@
+##############################################################################
+#
+# Copyright (c) 2007 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.
+#
+##############################################################################
+"""zope.app.i18nfile common test related classes/functions/objects.
+
+$Id$
+"""
+
+__docformat__ = "reStructuredText"
+
+import os
+from zope.app.testing.functional import ZCMLLayer
+
+I18nFileLayer = ZCMLLayer(
+    os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+    __name__, 'I18nFileLayer', allow_teardown=True)


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



More information about the Checkins mailing list