[Zope-Checkins] CVS: Zope3/lib/python/Zope/PageTemplate/tests - testDTMLTests.py:1.1.2.3 testExpressions.py:1.1.2.3 testHTMLTests.py:1.1.2.3 util.py:1.1.2.4

Fred Drake Jr fdrake@acm.org
Tue, 20 Nov 2001 13:01:47 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/PageTemplate/tests
In directory cvs.zope.org:/tmp/cvs-serv3402/tests

Modified Files:
      Tag: Zope-3x-branch
	testDTMLTests.py testExpressions.py testHTMLTests.py util.py 
Log Message:
Finish making the tests run for page templates in Zope 3.

=== Zope3/lib/python/Zope/PageTemplate/tests/testDTMLTests.py 1.1.2.2 => 1.1.2.3 ===
 
       aa=util.argv(('one', 'two', 'three', 'cha', 'cha', 'cha'))
-      o=self.t.__of__(aa)()
+      o=self.t.__get__(aa)()
       expect = util.read_output('DTML1a.html')
 
       util.check_xml(expect, o)
 
       aa=util.argv(())
-      o=self.t.__of__(aa)()
+      o=self.t.__get__(aa)()
       expect = util.read_output('DTML1b.html')
       util.check_xml(expect, o)
 
@@ -91,7 +91,7 @@
                     'sixteen', 'seventeen', 'eighteen', 'nineteen', 'twenty',
                     ))
       from Zope.PageTemplate.tests import batch        
-      o=self.t.__of__(aa)(batch=batch.batch(aa.args, 5))
+      o=self.t.__get__(aa)(batch=batch.batch(aa.args, 5))
 
       expect = util.read_output('DTML3.html')
       util.check_xml(expect, o)


=== Zope3/lib/python/Zope/PageTemplate/tests/testExpressions.py 1.1.2.2 => 1.1.2.3 ===
 import os, sys, unittest
 
-from Zope.PageTemplate import Expressions
+from Zope.PageTemplate.Expressions import getEngine
 
 class ExpressionTests(unittest.TestCase):
 


=== Zope3/lib/python/Zope/PageTemplate/tests/testHTMLTests.py 1.1.2.2 => 1.1.2.3 ===
 
 class Folder:
-   pass
+   def getContext(self):
+      return self
 
 class HTMLTests(unittest.TestCase):
 
@@ -42,7 +43,7 @@
    def check2(self):
       self.folder.laf.write(util.read_input('TeeShopLAF.html'))
 
-      t = self.folder.t
+      t = self.folder.t.__get__(self.folder)
       t.write(util.read_input('TeeShop2.html'))
       expect = util.read_output('TeeShop2.html')
       out = t(getProducts=self.getProducts)
@@ -52,7 +53,7 @@
    def check3(self):
       self.folder.laf.write(util.read_input('TeeShopLAF.html'))
 
-      t = self.folder.t
+      t = self.folder.t.__get__(self.folder)
       t.write(util.read_input('TeeShop1.html'))
       expect = util.read_output('TeeShop1.html')
       out = t(getProducts=self.getProducts)


=== Zope3/lib/python/Zope/PageTemplate/tests/util.py 1.1.2.3 => 1.1.2.4 ===
         if name[:1]=='_': raise AttributeError, name
         return self
-   
+
 bruce=Bruce()    
 
 class arg:
@@ -45,6 +45,9 @@
     def values(self): return self.args
 
     def getPhysicalRoot(self):
+        return self
+
+    def getContext(self):
         return self
 
 def nicerange(lo, hi):