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
2a45ffc2
Commit
2a45ffc2
authored
Nov 12, 2006
by
Jens Vagelpohl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Collector #2232: Can't call DTML templates from Page Templates
parent
1d8df798
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
3 deletions
+17
-3
doc/CHANGES.txt
doc/CHANGES.txt
+2
-0
lib/python/Products/PageTemplates/Expressions.py
lib/python/Products/PageTemplates/Expressions.py
+1
-1
lib/python/Products/PageTemplates/tests/testExpressions.py
lib/python/Products/PageTemplates/tests/testExpressions.py
+14
-2
No files found.
doc/CHANGES.txt
View file @
2a45ffc2
...
@@ -36,6 +36,8 @@ Zope Changes
...
@@ -36,6 +36,8 @@ Zope Changes
Bugs Fixed
Bugs Fixed
- Collector #2232: Can't call DTML templates from Page Templates
- Collector #2198: Zope 3.3 fix breaks Five 1.5 test_getNextUtility
- Collector #2198: Zope 3.3 fix breaks Five 1.5 test_getNextUtility
- Collector #2206: Set PYTHONPATH to include existing PYTHONPATH
- Collector #2206: Set PYTHONPATH to include existing PYTHONPATH
...
...
lib/python/Products/PageTemplates/Expressions.py
View file @
2a45ffc2
...
@@ -89,7 +89,7 @@ def render(ob, ns):
...
@@ -89,7 +89,7 @@ def render(ob, ns):
if
callable
(
base
):
if
callable
(
base
):
try
:
try
:
if
getattr
(
base
,
'isDocTemp'
,
0
):
if
getattr
(
base
,
'isDocTemp'
,
0
):
ob
=
call_with_ns
(
ob
,
ns
,
2
)
ob
=
ZRPythonExpr
.
call_with_ns
(
ob
,
ns
,
2
)
else
:
else
:
ob
=
ob
()
ob
=
ob
()
except
AttributeError
,
n
:
except
AttributeError
,
n
:
...
...
lib/python/Products/PageTemplates/tests/testExpressions.py
View file @
2a45ffc2
...
@@ -12,6 +12,12 @@ class Dummy:
...
@@ -12,6 +12,12 @@ class Dummy:
def
__call__
(
self
):
def
__call__
(
self
):
return
'dummy'
return
'dummy'
class
DummyDocumentTemplate
:
__allow_access_to_unprotected_subobjects__
=
1
isDocTemp
=
True
def
__call__
(
self
,
client
=
None
,
REQUEST
=
{},
RESPONSE
=
None
,
**
kw
):
return
'dummy'
class
ExpressionTests
(
zope
.
component
.
testing
.
PlacelessSetup
,
unittest
.
TestCase
):
class
ExpressionTests
(
zope
.
component
.
testing
.
PlacelessSetup
,
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -23,7 +29,8 @@ class ExpressionTests(zope.component.testing.PlacelessSetup, unittest.TestCase):
...
@@ -23,7 +29,8 @@ class ExpressionTests(zope.component.testing.PlacelessSetup, unittest.TestCase):
one
=
1
,
one
=
1
,
d
=
{
'one'
:
1
,
'b'
:
'b'
,
''
:
'blank'
,
'_'
:
'under'
},
d
=
{
'one'
:
1
,
'b'
:
'b'
,
''
:
'blank'
,
'_'
:
'under'
},
blank
=
''
,
blank
=
''
,
dummy
=
Dummy
()
dummy
=
Dummy
(),
dummy2
=
DummyDocumentTemplate
()
)
)
def
testCompile
(
self
):
def
testCompile
(
self
):
...
@@ -47,7 +54,12 @@ class ExpressionTests(zope.component.testing.PlacelessSetup, unittest.TestCase):
...
@@ -47,7 +54,12 @@ class ExpressionTests(zope.component.testing.PlacelessSetup, unittest.TestCase):
def
testRenderedEval
(
self
):
def
testRenderedEval
(
self
):
ec
=
self
.
ec
ec
=
self
.
ec
assert
ec
.
evaluate
(
'dummy'
)
==
'dummy'
self
.
assertEquals
(
ec
.
evaluate
(
'dummy'
),
'dummy'
)
# http://www.zope.org/Collectors/Zope/2232
# DTML templates could not be called from a Page Template
# due to an ImportError
self
.
assertEquals
(
ec
.
evaluate
(
'dummy2'
),
'dummy'
)
def
testEval1
(
self
):
def
testEval1
(
self
):
'''Test advanced expression evaluation 1'''
'''Test advanced expression evaluation 1'''
...
...
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