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
fa5c531f
Commit
fa5c531f
authored
Jun 06, 2008
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forward port fix for Launchpad #229549 from the 2.10 branch.
parent
04687d0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
lib/python/Products/PageTemplates/PageTemplate.py
lib/python/Products/PageTemplates/PageTemplate.py
+9
-1
lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
...thon/Products/PageTemplates/tests/testZopePageTemplate.py
+14
-0
No files found.
lib/python/Products/PageTemplates/PageTemplate.py
View file @
fa5c531f
...
...
@@ -68,7 +68,15 @@ class PageTemplate(ExtensionClass.Base,
def
pt_render
(
self
,
source
=
False
,
extra_context
=
{}):
c
=
self
.
pt_getContext
()
c
.
update
(
extra_context
)
return
super
(
PageTemplate
,
self
).
pt_render
(
c
,
source
=
source
)
debug
=
getattr
(
c
[
'request'
],
'debug'
,
None
)
if
debug
is
not
None
:
showtal
=
getattr
(
debug
,
'showTAL'
,
False
)
sourceAnnotations
=
getattr
(
debug
,
'sourceAnnotations'
,
False
)
else
:
showtal
=
sourceAnnotations
=
False
return
super
(
PageTemplate
,
self
).
pt_render
(
c
,
source
=
source
,
sourceAnnotations
=
sourceAnnotations
,
showtal
=
showtal
)
def
pt_errors
(
self
,
namespace
=
{}):
self
.
_cook_check
()
...
...
lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
View file @
fa5c531f
...
...
@@ -202,6 +202,20 @@ class ZPTUnicodeEncodingConflictResolution(ZopeTestCase):
state
=
cPickle
.
dumps
(
empty
,
protocol
=
1
)
clone
=
cPickle
.
loads
(
state
)
def
testDebugFlags
(
self
):
# Test for bug 229549
manage_addPageTemplate
(
self
.
app
,
'test'
,
text
=
'<div tal:content="string:foo">bar</div>'
,
encoding
=
'ascii'
)
zpt
=
self
.
app
[
'test'
]
from
zope.publisher.base
import
DebugFlags
self
.
app
.
REQUEST
.
debug
=
DebugFlags
()
self
.
assertEqual
(
zpt
.
pt_render
(),
unicode
(
'<div>foo</div>
\
n
'
))
self
.
app
.
REQUEST
.
debug
.
showTAL
=
True
self
.
assertEqual
(
zpt
.
pt_render
(),
unicode
(
'<div tal:content="string:foo">foo</div>
\
n
'
))
self
.
app
.
REQUEST
.
debug
.
sourceAnnotations
=
True
self
.
assertEqual
(
zpt
.
pt_render
().
startswith
(
unicode
(
'<!--'
)),
True
)
class
ZopePageTemplateFileTests
(
ZopeTestCase
):
def
test_class_conforms_to_IWriteLock
(
self
):
...
...
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