Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
9715d3af
Commit
9715d3af
authored
May 21, 2006
by
Philipp von Weitershausen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Discuss another BBB problem (noticeable due to a test failure).
parent
f8f12a52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletion
+30
-1
lib/python/Products/PageTemplates/tests/testExpressions.py
lib/python/Products/PageTemplates/tests/testExpressions.py
+30
-1
No files found.
lib/python/Products/PageTemplates/tests/testExpressions.py
View file @
9715d3af
...
...
@@ -75,11 +75,40 @@ class ExpressionTests(unittest.TestCase):
'''Test hybrid path expressions'''
ec
=
self
.
ec
assert
ec
.
evaluate
(
'x | python:1+1'
)
==
2
# XXX The following test fails because int here is called
# which yields 0, not the int type. Why is it called? Because
# PathExpr calls everything that's not on the trees by the
# time it has counted to three.
assert
ec
.
evaluate
(
'x | python:int'
)
==
int
# The whole expression is a PathExpr with two subexpressions:
# a SubPathExpr and a PythonExpr. The first fails as
# intended, so the second is evaluated. The result is called.
# The old PathExpr didn't do that. Specifically, it wouldn't
# call builtin types (str, unicode, dict, list, tuple, bool).
# There are two things we can do about this now:
# a) Nothing. Accept the incompatibility from Zope 2.9 to
# 2.10. Of course, this might break existing code, but
# there are ways to make code compatible with 2.9 and 2.10:
# Add a nocall: before the python: expression (if that's
# possible?!?). You just have to know about these things
# beforehand.
# b) Provide our own PathExpr implementation that does not
# blindly call primitive types. We would have to keep this
# code in Zope 2 forever which means there'd be an
# incompatibility between Zope 2 and Zope 3 ZPTs forever.
# I'm leaning towards option a). Given that this only turns
# out to be a problem with builtin types, the breakage is
# quite limited.
assert
ec
.
evaluate
(
'x | string:x'
)
==
'x'
assert
ec
.
evaluate
(
'x | string:$one'
)
==
'1'
assert
ec
.
evaluate
(
'x | not:exists:x'
)
def
testWrappers
(
self
):
"""Test if defer and lazy are returning their wrappers
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment