[Zope-CMF] Re: SVN: CMF/trunk/CMFCore/ - fixed the unit tests that
failed on Zope 2.10
yuppie
y.2006_ at wcm-solutions.de
Thu Jun 1 04:18:46 EDT 2006
Hi Philipp!
Philipp von Weitershausen wrote:
>> Log message for revision 68396:
>> - fixed the unit tests that failed on Zope 2.10
>>
>> (There is still one error, but that seems to be caused by a Zope bug.)
>
> Please file collector entries so that we know and eventually fix them.
Tres did that already: http://www.zope.org/Collectors/Zope/2117
>> +class Expression(Persistent):
>>
>> security = ClassSecurityInfo()
>>
>> def __init__(self, text):
>> self.text = text
>> - self._v_compiled = getEngine().compile(text)
>> + if text:
>> + self._v_compiled = getEngine().compile(text)
>
> May I suggest to make this test more robust for superfluous whitespace?:
>
> if test.strip():
> self._v_compiled = getEngine().compile(text)
Good idea. Done.
>> Modified: CMF/trunk/CMFCore/tests/test_Expression.py
>> ===================================================================
>> --- CMF/trunk/CMFCore/tests/test_Expression.py 2006-05-30 16:10:52 UTC (rev 68395)
>> +++ CMF/trunk/CMFCore/tests/test_Expression.py 2006-05-30 16:18:49 UTC (rev 68396)
>> @@ -49,21 +49,34 @@
>> def test_anonymous_ec(self):
>> self.portal.portal_membership = DummyMembershipTool()
>> ec = createExprContext(self.folder, self.portal, self.object)
>> - member = ec.global_vars['member']
>> + if hasattr(ec, 'contexts'):
>> + member = ec.contexts['member']
>> + else:
>> + # BBB: for Zope 2.9
>> + member = ec.global_vars['member']
>
> Please file a collector issue for this BBB problem.
I don't think this BBB issue has to be resolved in Zope. AFAICS
global_vars is not part of the API and CMF used it just for unit test hacks.
Cheers,
Yuppie
More information about the Zope-CMF
mailing list