[Zope3-checkins] SVN: Zope3/trunk/src/zope/testbrowser/ Added TestBrowserLayer for existing functional testing

Baiju M baiju.m.mail at gmail.com
Thu Jan 11 22:01:05 EST 2007


Log message for revision 71954:
  Added TestBrowserLayer for existing functional testing
  of zope.testbrowser package.
  

Changed:
  D   Zope3/trunk/src/zope/testbrowser/SETUP.cfg
  U   Zope3/trunk/src/zope/testbrowser/ftests/ftesting.zcml
  U   Zope3/trunk/src/zope/testbrowser/ftests/testdoc.py
  D   Zope3/trunk/src/zope/testbrowser/testbrowser-ftesting.zcml

-=-
Deleted: Zope3/trunk/src/zope/testbrowser/SETUP.cfg
===================================================================
--- Zope3/trunk/src/zope/testbrowser/SETUP.cfg	2007-01-12 01:28:29 UTC (rev 71953)
+++ Zope3/trunk/src/zope/testbrowser/SETUP.cfg	2007-01-12 03:01:03 UTC (rev 71954)
@@ -1,5 +0,0 @@
-# Tell zpkg how to install the ZCML slugs.
-
-<data-files zopeskel/etc/package-includes>
-  testbrowser-*.zcml
-</data-files>

Modified: Zope3/trunk/src/zope/testbrowser/ftests/ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/testbrowser/ftests/ftesting.zcml	2007-01-12 01:28:29 UTC (rev 71953)
+++ Zope3/trunk/src/zope/testbrowser/ftests/ftesting.zcml	2007-01-12 03:01:03 UTC (rev 71954)
@@ -1,7 +1,38 @@
-<configure xmlns="http://namespaces.zope.org/browser">
+<configure 
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:browser="http://namespaces.zope.org/browser"
+    i18n_domain="zope"
+    package="zope.testbrowser"
+    >
 
-  <resourceDirectory
+  <!-- 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.authentication" />
+
+  <!-- Principals -->
+
+  <unauthenticatedPrincipal
+      id="zope.anybody"
+      title="Unauthenticated User" />
+
+
+  <include package="zope.app.securitypolicy" file="meta.zcml"/>
+
+  <securityPolicy
+    component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+
+  <role id="zope.Anonymous" title="Everybody"
+                 description="All users have this role implicitly" />
+
+  <!-- Replace the following directive if you don't want public access -->
+  <grant permission="zope.View"
+                  role="zope.Anonymous" />
+
+
+  <browser:resourceDirectory
       name="testbrowser"
-      directory="." />
+      directory="ftests" />
 
 </configure>

Modified: Zope3/trunk/src/zope/testbrowser/ftests/testdoc.py
===================================================================
--- Zope3/trunk/src/zope/testbrowser/ftests/testdoc.py	2007-01-12 01:28:29 UTC (rev 71953)
+++ Zope3/trunk/src/zope/testbrowser/ftests/testdoc.py	2007-01-12 03:01:03 UTC (rev 71954)
@@ -15,15 +15,23 @@
 
 $Id$
 """
+import os
 import unittest
 import doctest
 from zope.app.testing.functional import FunctionalDocFileSuite
+from zope.app.testing import functional
 
+TestBrowserLayer = functional.ZCMLLayer(
+    os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+    __name__, 'TestBrowserLayer')
+
 def test_suite():
     flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS
     readme = FunctionalDocFileSuite('../README.txt', optionflags=flags)
+    readme.layer = TestBrowserLayer 
     wire = FunctionalDocFileSuite('../over_the_wire.txt', optionflags=flags)
     wire.level = 2
+    wire.layer = TestBrowserLayer 
     return unittest.TestSuite((readme, wire))
 
 if __name__ == '__main__':

Deleted: Zope3/trunk/src/zope/testbrowser/testbrowser-ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/testbrowser/testbrowser-ftesting.zcml	2007-01-12 01:28:29 UTC (rev 71953)
+++ Zope3/trunk/src/zope/testbrowser/testbrowser-ftesting.zcml	2007-01-12 03:01:03 UTC (rev 71954)
@@ -1 +0,0 @@
-<include package="zope.testbrowser.ftests" file="ftesting.zcml" />



More information about the Zope3-Checkins mailing list