Skip to content

Commit

Permalink
hopefully fixed the ioerror issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dobe committed May 29, 2007
1 parent 0b5c2f0 commit 686d949
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 5 deletions.
2 changes: 1 addition & 1 deletion buildout.cfg
@@ -1,5 +1,5 @@
[buildout]
develop = .
develop = . ../ZODB ../zope.app.testing
parts = test

[test]
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Expand Up @@ -15,6 +15,8 @@
package_dir = {'':'src'},
namespace_packages=['z3c',],
extras_require=dict(test=['zope.app.zcmlfiles',
'zope.testbrowser',
'zope.app.securitypolicy',
]),
install_requires = ['setuptools',
'ZODB3',
Expand Down
7 changes: 7 additions & 0 deletions src/z3c/testing/BROWSER.txt
@@ -1,3 +1,10 @@
=========
Browser
=========

>>> from zope.testbrowser.testing import Browser
>>> browser = Browser()
>>> browser.handleErrors = False
>>> browser.open('http://localhost/++skin++Rotterdam/index.html')
>>> browser.url
'http://localhost/++skin++Rotterdam/index.html'
9 changes: 8 additions & 1 deletion src/z3c/testing/ftests.py
Expand Up @@ -2,7 +2,14 @@
from zope.app.testing import functional
import unittest

layer.defineLayer('MyLayer', zcml='test.zcml')
def appSetUp(app):
# just some stupid assertion
assert(app.__name__ is None)


layer.defineLayer('MyLayer', zcml='test.zcml',
appSetUp=appSetUp, clean=True)


def test_suite():
suite = unittest.TestSuite()
Expand Down
8 changes: 5 additions & 3 deletions src/z3c/testing/layer.py
Expand Up @@ -32,7 +32,7 @@

class BufferedDatabaseTestLayer(object):
"""A test layer which creates a filestorage database.
The created database is later used without the need to run through the
setup again.
This speeds up functional tests.
Expand All @@ -56,7 +56,7 @@ def __init__(self, config_file=None, module=__module__,
def setUpApplication(self, app):
# to be overridden by subclass
pass

def setUp(self):
if not os.path.exists(self.dbDir):
os.mkdir(self.dbDir)
Expand All @@ -76,7 +76,9 @@ def setUp(self):
db.close()

fsetup.base_storage = FileStorage(filename)
fsetup.setUp()
#hm, somehow the setup closes the database, but we dont want
#this.
#fsetup.setUp()

def tearDown(self):
fsetup = functional.FunctionalTestSetup(self.config_file)
Expand Down
15 changes: 15 additions & 0 deletions src/z3c/testing/test.zcml
@@ -1,6 +1,9 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:zcml="http://namespaces.zope.org/zcml">

<include package="zope.app.securitypolicy" file="meta.zcml" />

<include
zcml:condition="installed zope.app.zcmlfiles"
package="zope.app.zcmlfiles"
Expand All @@ -9,4 +12,16 @@
zcml:condition="not-installed zope.app.zcmlfiles"
package="zope.app"
/>

<include package="zope.app.securitypolicy" />
<securityPolicy
component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />

<unauthenticatedPrincipal
id="zope.anybody"
title="Unauthenticated User" />

<grant permission="zope.View"
principal="zope.anybody" />

</configure>

0 comments on commit 686d949

Please sign in to comment.