[Zope3-checkins] CVS: Zope3/src/zope/app/form/tests - test_widget.py:1.4

Gary Poster gary at zope.com
Fri Sep 26 15:54:05 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/form/tests
In directory cvs.zope.org:/tmp/cvs-serv11773/form/tests

Modified Files:
	test_widget.py 
Log Message:
make title and description properties that translate themselves if possible.  Add description attribute to IWidget.



=== Zope3/src/zope/app/form/tests/test_widget.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/form/tests/test_widget.py:1.3	Thu Jan  9 09:13:10 2003
+++ Zope3/src/zope/app/form/tests/test_widget.py	Fri Sep 26 15:53:35 2003
@@ -38,12 +38,26 @@
         self.assertEqual(w.name, 'test.foo')
 
     def test_title(self):
+        from zope.app.tests.placelesssetup import setUp, tearDown
+        setUp()
         w = Widget(Text(__name__='foo', title=u'Foo title'), TestRequest())
         self.assertEqual(w.title, 'Foo title')
+        tearDown()
+
+    def test_description(self):
+        from zope.app.tests.placelesssetup import setUp, tearDown
+        setUp()
+        w = Widget(Text(__name__='foo', description=u'Foo desc'),
+                   TestRequest())
+        self.assertEqual(w.description, 'Foo desc')
+        tearDown()
 
     def test_IWidget(self):
+        from zope.app.tests.placelesssetup import setUp, tearDown
+        setUp()
         w = Widget(Text(__name__='foo', title=u'Foo title'), TestRequest())
         verifyObject(IWidget, w)
+        tearDown()
 
     # XXX Don't test getValue. It's silly and will go away.
 
@@ -52,12 +66,15 @@
     # XXX this test should be rewritten once we've refactored widget properties
 
     def test(self):
+        from zope.app.tests.placelesssetup import setUp, tearDown
+        setUp()
         cw = CustomWidget(Widget, width=60)
         verifyObject(IViewFactory, cw)
         w = cw(Text(__name__='foo', title=u'Foo title'), TestRequest())
         self.assertEqual(w.name, 'field.foo')
         self.assertEqual(w.width, 60)
         verifyObject(IWidget, w)
+        tearDown()
 
 
 




More information about the Zope3-Checkins mailing list