[Checkins] SVN: Zope3/trunk/src/zope/app/dtmlpage/ Added DTMLPageLayer for existing ftests.

Baiju M baiju.m.mail at gmail.com
Tue Mar 6 04:50:06 EST 2007


Log message for revision 73001:
  Added DTMLPageLayer for existing ftests.
  

Changed:
  A   Zope3/trunk/src/zope/app/dtmlpage/ftesting.zcml
  U   Zope3/trunk/src/zope/app/dtmlpage/ftests.py
  A   Zope3/trunk/src/zope/app/dtmlpage/testing.py

-=-
Added: Zope3/trunk/src/zope/app/dtmlpage/ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/app/dtmlpage/ftesting.zcml	2007-03-06 08:47:32 UTC (rev 73000)
+++ Zope3/trunk/src/zope/app/dtmlpage/ftesting.zcml	2007-03-06 09:50:04 UTC (rev 73001)
@@ -0,0 +1,45 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   i18n_domain="zope"
+   package="zope.app.dtmlpage"
+   >
+
+  <!-- This file is the equivalent of site.zcml and it is -->
+  <!-- used for functional testing setup -->
+
+  <include package="zope.app.preference" file="meta.zcml" />
+  <include package="zope.app.securitypolicy" file="meta.zcml" />
+
+  <include package="zope.app.zcmlfiles" />
+
+  <include package="zope.app.preference" />
+  <include package="zope.app.authentication" />
+  <include package="zope.app.dtmlpage" />
+
+  <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/dtmlpage/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: Zope3/trunk/src/zope/app/dtmlpage/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/dtmlpage/ftests.py	2007-03-06 08:47:32 UTC (rev 73000)
+++ Zope3/trunk/src/zope/app/dtmlpage/ftests.py	2007-03-06 09:50:04 UTC (rev 73001)
@@ -13,11 +13,12 @@
 ##############################################################################
 """Functional tests for DTML Page.
 
-$Id: ftests.py 25177 2004-06-02 13:17:31Z jim $
+$Id$
 """
 import unittest
 from zope.app.testing.functional import BrowserTestCase
 from zope.app.dtmlpage.dtmlpage import DTMLPage
+from zope.app.dtmlpage.testing import DTMLPageLayer
 from xml.sax.saxutils import escape
 
 class DTMLPageTest(BrowserTestCase):
@@ -112,9 +113,12 @@
 
 def test_suite():
     from zope.app.testing import functional
+    url = functional.FunctionalDocFileSuite('url.txt')
+    url.layer = DTMLPageLayer
+    DTMLPageTest.layer = DTMLPageLayer
     return unittest.TestSuite((
         unittest.makeSuite(DTMLPageTest),
-        functional.FunctionalDocFileSuite('url.txt'),
+        url,
         ))
 
 if __name__ == '__main__':

Added: Zope3/trunk/src/zope/app/dtmlpage/testing.py
===================================================================
--- Zope3/trunk/src/zope/app/dtmlpage/testing.py	2007-03-06 08:47:32 UTC (rev 73000)
+++ Zope3/trunk/src/zope/app/dtmlpage/testing.py	2007-03-06 09:50:04 UTC (rev 73001)
@@ -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.dtmlpage common test related classes/functions/objects.
+
+$Id$
+"""
+
+__docformat__ = "reStructuredText"
+
+import os
+from zope.app.testing.functional import ZCMLLayer
+
+DTMLPageLayer = ZCMLLayer(
+    os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+    __name__, 'DTMLPageLayer', allow_teardown=True)
+


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



More information about the Checkins mailing list