[Zope-Checkins] CVS: Zope3/lib/python/Zope/PageTemplate/tests - testDTMLTests.py:1.1.2.5 testHTMLTests.py:1.1.2.5
Fred L. Drake, Jr.
fdrake@acm.org
Fri, 1 Feb 2002 17:13:11 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/PageTemplate/tests
In directory cvs.zope.org:/tmp/cvs-serv4005
Modified Files:
Tag: Zope-3x-branch
testDTMLTests.py testHTMLTests.py
Log Message:
We need to use bound page templates, so use ZPT instead of PageTemplate, and
make sure we actually bind the template to the instance.
=== Zope3/lib/python/Zope/PageTemplate/tests/testDTMLTests.py 1.1.2.4 => 1.1.2.5 ===
from Zope.PageTemplate.tests import util
-from Zope.PageTemplate.PageTemplate import PageTemplate
+from Zope.PageTemplate.ZPT import ZPT
class DTMLTests(unittest.TestCase):
def setUp(self):
- self.t=(PageTemplate())
+ self.t=(ZPT())
def check1(self):
"""DTML test 1: if, in, and var:
=== Zope3/lib/python/Zope/PageTemplate/tests/testHTMLTests.py 1.1.2.4 => 1.1.2.5 ===
from Zope.PageTemplate.tests import util
-from Zope.PageTemplate.PageTemplate import PageTemplate
+from Zope.PageTemplate.ZPT import ZPT, BoundPageTemplate
class Folder:
@@ -19,8 +19,8 @@
def setUp(self):
self.folder = f = Folder()
- f.laf = PageTemplate()
- f.t = PageTemplate()
+ f.laf = ZPT()
+ f.t = ZPT()
def getProducts(self):
return [
@@ -35,7 +35,7 @@
]
def check1(self):
- laf = self.folder.laf
+ laf = self.folder.laf.__get__(self.folder)
laf.write(util.read_input('TeeShopLAF.html'))
expect = util.read_output('TeeShopLAF.html')
util.check_html(expect, laf())
@@ -60,56 +60,56 @@
util.check_html(expect, out)
def checkSimpleLoop(self):
- t = self.folder.t
+ t = self.folder.t.__get__(self.folder)
t.write(util.read_input('Loop1.html'))
expect = util.read_output('Loop1.html')
out = t()
util.check_html(expect, out)
def checkGlobalsShadowLocals(self):
- t = self.folder.t
+ t = self.folder.t.__get__(self.folder)
t.write(util.read_input('GlobalsShadowLocals.html'))
expect = util.read_output('GlobalsShadowLocals.html')
out = t()
util.check_html(expect, out)
def checkStringExpressions(self):
- t = self.folder.t
+ t = self.folder.t.__get__(self.folder)
t.write(util.read_input('StringExpression.html'))
expect = util.read_output('StringExpression.html')
out = t()
util.check_html(expect, out)
def checkReplaceWithNothing(self):
- t = self.folder.t
+ t = self.folder.t.__get__(self.folder)
t.write(util.read_input('CheckNothing.html'))
expect = util.read_output('CheckNothing.html')
out = t()
util.check_html(expect, out)
def checkWithXMLHeader(self):
- t = self.folder.t
+ t = self.folder.t.__get__(self.folder)
t.write(util.read_input('CheckWithXMLHeader.html'))
expect = util.read_output('CheckWithXMLHeader.html')
out = t()
util.check_html(expect, out)
def checkNotExpression(self):
- t = self.folder.t
+ t = self.folder.t.__get__(self.folder)
t.write(util.read_input('CheckNotExpression.html'))
expect = util.read_output('CheckNotExpression.html')
out = t()
util.check_html(expect, out)
def checkPathNothing(self):
- t = self.folder.t
+ t = self.folder.t.__get__(self.folder)
t.write(util.read_input('CheckPathNothing.html'))
expect = util.read_output('CheckPathNothing.html')
out = t()
util.check_html(expect, out)
def checkPathAlt(self):
- t = self.folder.t
+ t = self.folder.t.__get__(self.folder)
t.write(util.read_input('CheckPathAlt.html'))
expect = util.read_output('CheckPathAlt.html')
out = t()