Prepare test case for a time when http://www.zope.org/Collectors/Zope3-dev/639

is fixed. Because then we need to have an ITraversable registered evne when
traversing dicts. For now this doesn't do harm.
parent 0d3f2c48
import unittest
import zope.component.testing
from zope.traversing.adapters import DefaultTraversable
from Products.PageTemplates import Expressions
from Products.PageTemplates.DeferExpr import LazyWrapper
from Products.PageTemplates.DeferExpr import DeferWrapper
......@@ -9,9 +12,12 @@ class Dummy:
def __call__(self):
return 'dummy'
class ExpressionTests(unittest.TestCase):
class ExpressionTests(zope.component.testing.PlacelessSetup, unittest.TestCase):
def setUp(self):
super(ExpressionTests, self).setUp()
zope.component.provideAdapter(DefaultTraversable, (None,))
self.e = e = Expressions.getEngine()
self.ec = e.getContext(
one = 1,
......@@ -20,9 +26,6 @@ class ExpressionTests(unittest.TestCase):
dummy = Dummy()
)
def tearDown(self):
del self.e, self.ec
def testCompile(self):
'''Test expression compilation'''
e = self.e
......
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