[Checkins] SVN: z3checkins/trunk/src/z3checkins/ftests/ Create a test layer for z3checkins functional tests.

Marius Gedminas marius at pov.lt
Thu Sep 27 16:01:02 EDT 2007


Log message for revision 80255:
  Create a test layer for z3checkins functional tests.
  
  z3checkins was the only remaining package included in the Zope 3 trunk with a
  test layer that didn't have allow_teardown=True, and it forced tests running
  after into a subprocess.
  
  

Changed:
  A   z3checkins/trunk/src/z3checkins/ftests/ftesting.zcml
  U   z3checkins/trunk/src/z3checkins/ftests/test_z3checkins.py

-=-
Added: z3checkins/trunk/src/z3checkins/ftests/ftesting.zcml
===================================================================
--- z3checkins/trunk/src/z3checkins/ftests/ftesting.zcml	                        (rev 0)
+++ z3checkins/trunk/src/z3checkins/ftests/ftesting.zcml	2007-09-27 20:01:02 UTC (rev 80255)
@@ -0,0 +1,74 @@
+<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.zcmlfiles" file="ftesting.zcml" />
+
+  <include package="zope.app.securitypolicy" file="meta.zcml" />
+  <include package="zope.app.securitypolicy" />
+  <include package="zope.app.authentication" />
+
+  <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" />
+  <role id="zope.Member" title="Site Member" />
+
+  <!-- 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" />
+
+  <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" />
+
+  <include package="z3checkins" />
+
+</configure>


Property changes on: z3checkins/trunk/src/z3checkins/ftests/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: z3checkins/trunk/src/z3checkins/ftests/test_z3checkins.py
===================================================================
--- z3checkins/trunk/src/z3checkins/ftests/test_z3checkins.py	2007-09-27 19:47:27 UTC (rev 80254)
+++ z3checkins/trunk/src/z3checkins/ftests/test_z3checkins.py	2007-09-27 20:01:02 UTC (rev 80255)
@@ -7,11 +7,19 @@
 
 import unittest
 import os
-from zope.app.testing.functional import BrowserTestCase
 
+from zope.app.testing.functional import BrowserTestCase, ZCMLLayer
 
+
+Z3CheckinsLayer = ZCMLLayer(
+    os.path.join(os.path.dirname(__file__), 'ftesting.zcml'),
+    __name__, 'Z3CheckinsLayer', allow_teardown=True)
+
+
 class TestCheckins(BrowserTestCase):
 
+    layer = Z3CheckinsLayer
+
     container_views = ('index.html', 'checkins-sidebar.html', 'checkins.rss')
     message_views = ('index.html', 'index.txt')
     resources = ('zope3.png', 'product.png', 'branch.png', 'message.png')



More information about the Checkins mailing list