A recent fix in the zope 3 traversing code now requires the ITraversable

adapter to be present even when traversing just dicts. No problem, we can
set it up quite easily.

This basically finishes this branch. All tests pass, some 3rd party apps
have been tested with it. There are a few test failures in the CMF and
others (e.g. Plone), but that's mostly "their fault" (incorrect or
unexpected usage of certain things).
parent bda7f98e
......@@ -10,7 +10,8 @@ Note: Tests require Zope >= 2.7
import unittest
import Zope2
import transaction
import zope.component.testing
from zope.traversing.adapters import DefaultTraversable
from Testing.makerequest import makerequest
class ZPTRegressions(unittest.TestCase):
......@@ -57,9 +58,12 @@ class ZPTRegressions(unittest.TestCase):
pt = self.app.pt1
self.assertEqual(pt.document_src(), self.text)
class ZPTMacros(unittest.TestCase):
class ZPTMacros(zope.component.testing.PlacelessSetup, unittest.TestCase):
def setUp(self):
super(ZPTMacros, self).setUp()
zope.component.provideAdapter(DefaultTraversable, (None,))
transaction.begin()
self.app = makerequest(Zope2.app())
f = self.app.manage_addProduct['PageTemplates'].manage_addPageTemplate
......@@ -89,6 +93,8 @@ class ZPTMacros(unittest.TestCase):
"""
def tearDown(self):
super(ZPTMacros, self).tearDown()
transaction.abort()
self.app._p_jar.close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment