[Zope3-checkins] CVS: Zope3/src/zope/app/pagetemplate/tests - testusage.pt:1.1.2.1 test_viewzpt.py:1.4.4.1
Godefroid Chapelle
gotcha@swing.be
Fri, 14 Mar 2003 04:46:20 -0500
Update of /cvs-repository/Zope3/src/zope/app/pagetemplate/tests
In directory cvs.zope.org:/tmp/cvs-serv1082/tests
Modified Files:
Tag: template_usage-branch
test_viewzpt.py
Added Files:
Tag: template_usage-branch
testusage.pt
Log Message:
more tests
=== Added File Zope3/src/zope/app/pagetemplate/tests/testusage.pt ===
<html><body><tal:usage replace="usage" /></body></html>
=== Zope3/src/zope/app/pagetemplate/tests/test_viewzpt.py 1.4 => 1.4.4.1 ===
--- Zope3/src/zope/app/pagetemplate/tests/test_viewzpt.py:1.4 Tue Feb 11 21:17:24 2003
+++ Zope3/src/zope/app/pagetemplate/tests/test_viewzpt.py Fri Mar 14 04:46:19 2003
@@ -90,8 +90,31 @@
self.failUnless(the_view is views[the_view_name])
+class TestViewZPTUsage(PlacefulSetup, unittest.TestCase):
+
+ def setUp(self):
+ PlacefulSetup.setUp(self)
+ self.context = C1()
+ self.context.request = None
+
+ def checkInitWithUsage(self):
+ self.t = ViewPageTemplateFile('testusage.pt', usage="test")
+ result = self.t(self.context)
+ self.assertEquals(result, "<html><body>test</body></html>")
+ result = self.t(self.context, template_usage="other")
+ self.assertEquals(result, "<html><body>other</body></html>")
+
+ def checkInitWithoutUsage(self):
+ self.t = ViewPageTemplateFile('testusage.pt')
+ result = self.t(self.context)
+ self.assertEquals(result, "<html><body></body></html>")
+ result = self.t(self.context, template_usage="other")
+ self.assertEquals(result, "<html><body>other</body></html>")
+
+
def test_suite():
return unittest.makeSuite(TestViewZPT, 'check')
+ return unittest.makeSuite(TestViewZPTUsage, 'check')
if __name__ == '__main__':
unittest.TextTestRunner().run(test_suite())