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
c5db98e7
Commit
c5db98e7
authored
Apr 21, 2006
by
Lennart Regebro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Macro expansion currenty fails. I checked in a test that reproduces the error.
parent
ae79aa21
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
1 deletion
+41
-1
lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
...thon/Products/PageTemplates/tests/testZopePageTemplate.py
+41
-1
No files found.
lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
View file @
c5db98e7
...
...
@@ -58,6 +58,44 @@ class ZPTRegressions(unittest.TestCase):
pt
=
self
.
app
.
pt1
self
.
assertEqual
(
pt
.
document_src
(),
self
.
text
)
class
ZPTMacros
(
unittest
.
TestCase
):
def
setUp
(
self
):
transaction
.
begin
()
self
.
app
=
makerequest
(
Zope2
.
app
())
f
=
self
.
app
.
manage_addProduct
[
'PageTemplates'
].
manage_addPageTemplate
self
.
_addPT
=
f
self
.
title
=
'title of page template'
self
.
text
=
"""
<metal:block use-macro="template/macros/themacro">
<p metal:fill-slot="theslot">
This is in the slot
</p>
</metal:block>
<tal:block condition="default">
<div metal:define-macro="themacro">
<h1>This is the header</h1>
<p metal:define-slot="theslot">
This will be replaced
</p>
</div>
</tal:block>
"""
self
.
result
=
"""
<div>
<h1>This is the header</h1>
<p>
This is in the slot
</p>
</div>
"""
def
testMacroExpansion
(
self
):
request
=
self
.
app
.
REQUEST
self
.
_addPT
(
'pt1'
,
text
=
self
.
text
,
REQUEST
=
request
)
pt
=
self
.
app
.
pt1
self
.
assertEqual
(
pt
(),
self
.
result
)
class
DummyFileUpload
:
...
...
@@ -71,7 +109,9 @@ class DummyFileUpload:
def
test_suite
():
return
unittest
.
makeSuite
(
ZPTRegressions
)
suite
=
unittest
.
makeSuite
(
ZPTRegressions
)
suite
.
addTests
(
unittest
.
makeSuite
(
ZPTMacros
))
return
suite
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
...
...
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