[Checkins] SVN: zope.app.publication/branches/sylvain-testlayers/s Get rid of zope.app.zcmlfiles.
Sylvain Viollon
sylvain at infrae.com
Tue Apr 13 11:26:05 EDT 2010
Log message for revision 110807:
Get rid of zope.app.zcmlfiles.
Changed:
U zope.app.publication/branches/sylvain-testlayers/setup.py
U zope.app.publication/branches/sylvain-testlayers/src/zope/app/publication/ftesting.zcml
U zope.app.publication/branches/sylvain-testlayers/src/zope/app/publication/httpfactory.txt
U zope.app.publication/branches/sylvain-testlayers/src/zope/app/publication/methodnotallowed.txt
U zope.app.publication/branches/sylvain-testlayers/src/zope/app/publication/testing.py
U zope.app.publication/branches/sylvain-testlayers/src/zope/app/publication/tests/test_zopepublication.py
-=-
Modified: zope.app.publication/branches/sylvain-testlayers/setup.py
===================================================================
--- zope.app.publication/branches/sylvain-testlayers/setup.py 2010-04-13 15:20:25 UTC (rev 110806)
+++ zope.app.publication/branches/sylvain-testlayers/setup.py 2010-04-13 15:26:04 UTC (rev 110807)
@@ -53,13 +53,22 @@
namespace_packages=['zope', 'zope.app'],
extras_require = dict(
test=['zope.app.testing',
- 'zope.app.zcmlfiles>=3.5.4',
+ 'zope.annotation',
+ 'zope.app.appsetup',
+ 'zope.app.exception',
+ 'zope.app.http',
+ 'zope.app.publication',
'zope.app.wsgi',
- 'zope.principalregistry',
'zope.applicationcontrol>=3.5.0',
- 'zope.site',
+ 'zope.authentication',
+ 'zope.browserpage',
'zope.login',
- ]),
+ 'zope.password',
+ 'zope.principalregistry',
+ 'zope.publisher',
+ 'zope.security',
+ 'zope.securitypolicy',
+ 'zope.site']),
install_requires=['zope.interface',
'ZODB3',
'zope.authentication',
Modified: zope.app.publication/branches/sylvain-testlayers/src/zope/app/publication/ftesting.zcml
===================================================================
--- zope.app.publication/branches/sylvain-testlayers/src/zope/app/publication/ftesting.zcml 2010-04-13 15:20:25 UTC (rev 110806)
+++ zope.app.publication/branches/sylvain-testlayers/src/zope/app/publication/ftesting.zcml 2010-04-13 15:26:04 UTC (rev 110807)
@@ -1,36 +1,53 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:meta="http://namespaces.zope.org/meta"
+ xmlns:browser="http://namespaces.zope.org/browser"
i18n_domain="zope"
package="zope.app.publication">
- <!-- This file is the equivalent of site.zcml and it is -->
- <!-- used for functional testing setup -->
+ <include package="zope.component" file="meta.zcml"/>
+ <include package="zope.app.publication" file="meta.zcml" />
+ <include package="zope.browserpage" file="meta.zcml" />
+
+ <include package="zope.app.publication" />
+
+ <include package="zope.security" file="meta.zcml" />
+ <include package="zope.publisher" file="meta.zcml" />
+ <include package="zope.principalregistry" file="meta.zcml" />
+ <include package="zope.browserpage" file="meta.zcml" />
+ <include package="zope.app.publication" file="meta.zcml" />
<include package="zope.securitypolicy" file="meta.zcml" />
- <include package="zope.app.zcmlfiles" />
- <include package="zope.app.authentication" />
<include package="zope.login" />
+ <include package="zope.security" />
+ <include package="zope.authentication" />
+ <include package="zope.securitypolicy" />
+ <include package="zope.principalregistry" />
+ <include package="zope.app.publication" />
+ <include package="zope.app.appsetup" file="ftesting.zcml"/>
+ <include package="zope.app.exception.browser" />
+ <include package="zope.app.http" />
+ <include package="zope.annotation" />
+ <include package="zope.publisher" />
+ <include package="zope.password" />
+ <include package="zope.browserpage" />
+ <include package="zope.app.wsgi" />
<securityPolicy
- component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+ component="zope.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" />
<!-- Principals -->
-
<unauthenticatedPrincipal
id="zope.anybody"
title="Unauthenticated User" />
+ <grant
+ permission="zope.View"
+ principal="zope.anybody" />
<!-- Principal that tests generally run as -->
<principal
@@ -39,13 +56,14 @@
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.mgr" />
- <grant role="zope.Manager" principal="zope.globalmgr" />
+ <browser:defaultView name="test.html" />
+ <browser:page
+ for="*"
+ class=".testing.DefaultTestView"
+ name="test.html"
+ permission="zope.View" />
+
</configure>
Modified: zope.app.publication/branches/sylvain-testlayers/src/zope/app/publication/httpfactory.txt
===================================================================
--- zope.app.publication/branches/sylvain-testlayers/src/zope/app/publication/httpfactory.txt 2010-04-13 15:20:25 UTC (rev 110806)
+++ zope.app.publication/branches/sylvain-testlayers/src/zope/app/publication/httpfactory.txt 2010-04-13 15:26:04 UTC (rev 110807)
@@ -17,7 +17,7 @@
... """)
HTTP/1.0 200 OK
X-Powered-By: Zope (www.zope.org), Python (www.python.org)
- Content-Length: 4322
+ Content-Length: ...
Content-Type: text/html;charset=utf-8
...
>>> print http(r"""
@@ -25,7 +25,7 @@
... """)
HTTP/1.0 200 OK
X-Powered-By: Zope (www.zope.org), Python (www.python.org)
- Content-Length: 4322
+ Content-Length: ...
Content-Type: text/html;charset=utf-8
...
>>> print http(r"""
Modified: zope.app.publication/branches/sylvain-testlayers/src/zope/app/publication/methodnotallowed.txt
===================================================================
--- zope.app.publication/branches/sylvain-testlayers/src/zope/app/publication/methodnotallowed.txt 2010-04-13 15:20:25 UTC (rev 110806)
+++ zope.app.publication/branches/sylvain-testlayers/src/zope/app/publication/methodnotallowed.txt 2010-04-13 15:26:04 UTC (rev 110807)
@@ -13,8 +13,7 @@
X-Powered-By: Zope (www.zope.org), Python (www.python.org)
Content-Length: 18
Allow: DELETE, OPTIONS, PUT
- <BLANKLINE>
- Method Not Allowed
+ ...
>>> print http(r"""
... DELETE / HTTP/1.1
Modified: zope.app.publication/branches/sylvain-testlayers/src/zope/app/publication/testing.py
===================================================================
--- zope.app.publication/branches/sylvain-testlayers/src/zope/app/publication/testing.py 2010-04-13 15:20:25 UTC (rev 110806)
+++ zope.app.publication/branches/sylvain-testlayers/src/zope/app/publication/testing.py 2010-04-13 15:26:04 UTC (rev 110807)
@@ -19,7 +19,17 @@
__docformat__ = "reStructuredText"
from zope.app.wsgi.testlayer import BrowserLayer
+from zope.publisher.browser import BrowserPage
import zope.app.publication
+
+class DefaultTestView(BrowserPage):
+
+ def __call__(self):
+ self.request.response.setHeader(
+ 'Content-Type', 'text/html;charset=utf-8')
+ return "<html><body>Test</body></html>"
+
+
PublicationLayer = BrowserLayer(zope.app.publication, name='PublicationLayer')
Modified: zope.app.publication/branches/sylvain-testlayers/src/zope/app/publication/tests/test_zopepublication.py
===================================================================
--- zope.app.publication/branches/sylvain-testlayers/src/zope/app/publication/tests/test_zopepublication.py 2010-04-13 15:20:25 UTC (rev 110806)
+++ zope.app.publication/branches/sylvain-testlayers/src/zope/app/publication/tests/test_zopepublication.py 2010-04-13 15:26:04 UTC (rev 110807)
@@ -48,7 +48,7 @@
from zope.security.interfaces import IPrincipal
from zope.principalregistry.principalregistry import principalRegistry
from zope.app.publication.zopepublication import ZopePublication
-from zope.app.folder import Folder, rootFolder
+from zope.site.folder import Folder, rootFolder
class Principal(object):
@@ -124,7 +124,7 @@
app = getattr(root, ZopePublication.root_name, None)
if app is None:
- from zope.app.folder import rootFolder
+ from zope.site.folder import rootFolder
app = rootFolder()
root[ZopePublication.root_name] = app
transaction.commit()
@@ -226,10 +226,10 @@
def _view(obj, request):
return lambda: view_text
-
+
component.provideAdapter(_view, (E1, self.presentation_type),
Interface, name='name')
-
+
try:
raise E1
except:
@@ -285,7 +285,7 @@
component.provideAdapter(MyView, (E2, self.presentation_type),
Interface, name='name')
-
+
try:
raise E2
except:
@@ -470,7 +470,7 @@
# unauthenticated principal.
authentication = AuthUtility3()
component.provideUtility(authentication, IAuthentication)
-
+
# We need a fallback unauthenticated principal, otherwise we'll get a
# ComponentLookupError:
self.assertRaises(ComponentLookupError,
@@ -501,14 +501,14 @@
setup.addUtility(sm2, '', IAuthentication, AuthUtility2())
transaction.commit()
- from zope.app.container.interfaces import ISimpleReadContainer
- from zope.app.container.traversal import ContainerTraverser
+ from zope.container.interfaces import ISimpleReadContainer
+ from zope.container.traversal import ContainerTraverser
component.provideAdapter(ContainerTraverser,
(ISimpleReadContainer, IRequest),
IPublishTraverse, name='')
-
- from zope.app.folder.interfaces import IFolder
+
+ from zope.site.interfaces import IFolder
from zope.security.checker import defineChecker, InterfaceChecker
defineChecker(Folder, InterfaceChecker(IFolder))
@@ -616,7 +616,7 @@
component.provideHandler(set.append, (IBeforeTraverseEvent,))
component.provideHandler(clear.append, (IEndRequestEvent,))
-
+
ob = object()
# This should fire the BeforeTraverseEvent
More information about the checkins
mailing list