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
b2316f74
Commit
b2316f74
authored
May 14, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method to test automatic rendering of vars.
parent
93bd932f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
+20
-9
lib/python/DocumentTemplate/DTtest.py
lib/python/DocumentTemplate/DTtest.py
+20
-9
No files found.
lib/python/DocumentTemplate/DTtest.py
View file @
b2316f74
...
...
@@ -2,7 +2,7 @@
"""Document Template Tests
"""
__rcs_id__
=
'$Id: DTtest.py,v 1.
4 1998/04/02 17:37:38
jim Exp $'
__rcs_id__
=
'$Id: DTtest.py,v 1.
5 1998/05/14 16:24:34
jim Exp $'
############################################################################
# Copyright
...
...
@@ -56,7 +56,7 @@ __rcs_id__='$Id: DTtest.py,v 1.4 1998/04/02 17:37:38 jim Exp $'
# (540) 371-6909
#
############################################################################
__version__
=
'$Revision: 1.
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
5
$'
[
11
:
-
2
]
from
DocumentTemplate
import
*
import
sys
...
...
@@ -485,6 +485,21 @@ def test12():
except
:
return
raise
'DocumentTemplate bug'
,
(
'Puke error not properly propigated in test 12'
)
def
test13
():
"Test automatic rendering of callable obnjects"
class
C
:
x
=
1
def
y
(
self
):
return
self
.
x
*
2
h
=
HTML
(
"The h method, <!--#var x--> <!--#var y-->"
)
h2
=
HTML
(
"The h2 method"
)
print
HTML
(
"<!--#var x-->, <!--#var y-->, <!--#var h-->"
)(
C
())
print
HTML
(
"""
<!--#var expr="_.render(i.x)"-->,
<!--#var expr="_.render(i.y)"-->,
<!--#var expr="_.render(i.h2)"-->"""
)(
i
=
C
())
def
main
():
import
traceback
...
...
@@ -518,13 +533,6 @@ def main():
print
'Test 11'
,
'='
*
60
try
:
test11
()
except
:
traceback
.
print_exc
()
def
test13
():
print
HTML
(
'''
<!--#in items-->
<!--#var sequence-key-->: <!--#var sequence-item-->
<!--#/in items-->
'''
)({
'spam'
:
'eggs'
,
'cool'
:
'DC'
})
if
__name__
==
"__main__"
:
...
...
@@ -534,6 +542,9 @@ if __name__ == "__main__":
############################################################################
# $Log: DTtest.py,v $
# Revision 1.5 1998/05/14 16:24:34 jim
# Add method to test automatic rendering of vars.
#
# Revision 1.4 1998/04/02 17:37:38 jim
# Major redesign of block rendering. The code inside a block tag is
# compiled as a template but only the templates blocks are saved, and
...
...
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