[Checkins] SVN: Zope3/trunk/src/zope/app/applicationcontrol/ Use ApplicationControlLayer for all ftests.

Baiju M baiju.m.mail at gmail.com
Fri Feb 9 04:14:27 EST 2007


Log message for revision 72480:
  Use ApplicationControlLayer for all ftests.
  

Changed:
  D   Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/ftesting.zcml
  U   Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_errorredirect.py
  U   Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_translationdomaincontrol.py
  U   Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_zodbcontrol.py
  A   Zope3/trunk/src/zope/app/applicationcontrol/ftesting.zcml
  A   Zope3/trunk/src/zope/app/applicationcontrol/testing.py

-=-
Deleted: Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/ftesting.zcml	2007-02-09 07:46:20 UTC (rev 72479)
+++ Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/ftesting.zcml	2007-02-09 09:14:25 UTC (rev 72480)
@@ -1,56 +0,0 @@
-<configure xmlns="http://namespaces.zope.org/zope"
-           xmlns:browser="http://namespaces.zope.org/browser"
-           xmlns:meta="http://namespaces.zope.org/meta"
-           i18n_domain="zope">
-
-  <include package="zope.app.zcmlfiles" />
-  <include package="zope.app.securitypolicy" file="meta.zcml" />
-  <include package="zope.app.server" />
-  <include package="zope.app.authentication" />
-  
-  <securityPolicy
-      component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
-
-  <include package="zope.app.securitypolicy" />
-
-  <role id="zope.Anonymous" title="Everybody"
-        description="All users have this role implicitly" />
-
-  <role id="zope.Manager" title="Site Manager" />
-
-  
-  <principal
-   id="zope.manager"
-   title="Administrator"
-   login="mgr"
-   password="mgrpw" />
-  <grant
-   role="zope.Manager"
-   principal="zope.manager"
-   />
-  
-  <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" 
-    />
-  
-  <grant permission="zope.View"
-         role="zope.Anonymous" />
-  
-  <grantAll role="zope.Manager" />
-
-</configure>
\ No newline at end of file

Modified: Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_errorredirect.py
===================================================================
--- Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_errorredirect.py	2007-02-09 07:46:20 UTC (rev 72479)
+++ Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_errorredirect.py	2007-02-09 09:14:25 UTC (rev 72480)
@@ -18,8 +18,8 @@
 import unittest
 
 from zope.app.testing.functional import BrowserTestCase
+from zope.app.applicationcontrol.testing import ApplicationControlLayer
 
-
 class ErrorRedirectTest(BrowserTestCase):
 
     def testErrorRedirect(self):
@@ -32,6 +32,7 @@
 
 def test_suite():
     suite = unittest.TestSuite()
+    ErrorRedirectTest.layer = ApplicationControlLayer
     suite.addTest(unittest.makeSuite(ErrorRedirectTest))
     return suite
 

Modified: Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_translationdomaincontrol.py
===================================================================
--- Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_translationdomaincontrol.py	2007-02-09 07:46:20 UTC (rev 72479)
+++ Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_translationdomaincontrol.py	2007-02-09 09:14:25 UTC (rev 72480)
@@ -17,6 +17,7 @@
 """
 import unittest
 from zope.app.testing.functional import BrowserTestCase
+from zope.app.applicationcontrol.testing import ApplicationControlLayer
 
 class MessageCatalogControlTest(BrowserTestCase):
 
@@ -43,6 +44,7 @@
 
 def test_suite():
     suite = unittest.TestSuite()
+    MessageCatalogControlTest.layer = ApplicationControlLayer
     suite.addTest(unittest.makeSuite(MessageCatalogControlTest))
     return suite
 

Modified: Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_zodbcontrol.py
===================================================================
--- Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_zodbcontrol.py	2007-02-09 07:46:20 UTC (rev 72479)
+++ Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_zodbcontrol.py	2007-02-09 09:14:25 UTC (rev 72480)
@@ -21,9 +21,8 @@
 from zope.app.testing import functional
 from zope import component
 
+from zope.app.applicationcontrol.testing import ApplicationControlLayer
 
-functional.defineLayer('ApplicationControlLayer', 'ftesting.zcml')
-
 def setUp(test):
     test.databases = test.globs['getRootFolder']()._p_jar.db().databases
     db2 = ZODB.tests.util.DB(databases=test.databases, database_name='2')
@@ -39,14 +38,11 @@
 
 def test_suite():
     suite = unittest.TestSuite()
-    suites = (
-        functional.FunctionalDocFileSuite('zodb.txt',
-                                          setUp=setUp, tearDown=tearDown,
-                                         ),
-        )
-    for s in suites:
-        s.layer=ApplicationControlLayer
-        suite.addTest(s)
+    zodb = functional.FunctionalDocFileSuite('zodb.txt',
+                                             setUp=setUp,
+                                             tearDown=tearDown)
+    zodb.layer = ApplicationControlLayer
+    suite.addTest(zodb)
     return suite
 
 

Added: Zope3/trunk/src/zope/app/applicationcontrol/ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/app/applicationcontrol/ftesting.zcml	2007-02-09 07:46:20 UTC (rev 72479)
+++ Zope3/trunk/src/zope/app/applicationcontrol/ftesting.zcml	2007-02-09 09:14:25 UTC (rev 72480)
@@ -0,0 +1,42 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   i18n_domain="zope"
+   package="zope.app.applicationcontrol"
+   >
+
+  <!-- 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" />
+
+  <securityPolicy
+    component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+
+  <role id="zope.Manager" title="Site Manager" />
+
+  <grantAll role="zope.Manager" />
+
+  <!-- Principal that tests generally run as -->
+
+  <principal
+      id="zope.manager"
+      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.manager" />
+  <grant role="zope.Manager" principal="zope.globalmgr" />
+
+</configure>


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

Added: Zope3/trunk/src/zope/app/applicationcontrol/testing.py
===================================================================
--- Zope3/trunk/src/zope/app/applicationcontrol/testing.py	2007-02-09 07:46:20 UTC (rev 72479)
+++ Zope3/trunk/src/zope/app/applicationcontrol/testing.py	2007-02-09 09:14:25 UTC (rev 72480)
@@ -0,0 +1,27 @@
+##############################################################################
+#
+# 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.applicationcontrol common test related classes/functions/objects.
+
+$Id$
+"""
+
+__docformat__ = "reStructuredText"
+
+import os
+from zope.app.testing.functional import ZCMLLayer
+
+ApplicationControlLayer = ZCMLLayer(
+    os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+    __name__, 'ApplicationControlLayer', allow_teardown=True)
+


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



More information about the Checkins mailing list