[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form/ftests - test_registrations.py:1.1.2.2

Garrett Smith garrett at mojave-corp.com
Sun Feb 8 23:32:15 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/browser/form/ftests
In directory cvs.zope.org:/tmp/cvs-serv11138/src/zope/app/browser/form/ftests

Modified Files:
      Tag: ozzope-widgets-branch
	test_registrations.py 
Log Message:

Continued refactoring of widgets. Now using view types to lookup widgets
when constructing forms instead of magic names. Next steps include
integration tests for registered widgets, fix existing tests, update
documentation, and fix vocab widgets.


=== Zope3/src/zope/app/browser/form/ftests/test_registrations.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/browser/form/ftests/test_registrations.py:1.1.2.1	Sun Feb  8 20:16:02 2004
+++ Zope3/src/zope/app/browser/form/ftests/test_registrations.py	Sun Feb  8 23:31:44 2004
@@ -11,13 +11,28 @@
 
 class Tests:
     """
-    The following illustrates the typical widget registrations for field types:
+    The following illustrates the typical widget registrations for field and
+    display type combinations:
         
-    TextWidget -> ITextLine
+    IField, IDisplayWidget -> DisplayWidget
+        
+        >>> object = fields.Field()
+        >>> widget = zapi.getViewProviding(object, IDisplayWidget, request)
+        >>> isinstance(widget, widgets.DisplayWidget)
+        True
+        
+    ITextLine, IEditWidget -> TextWidget 
         
         >>> text = fields.TextLine()
         >>> widget = zapi.getViewProviding(text, IEditWidget, request)
         >>> isinstance(widget, widgets.TextWidget)
+        True
+        
+    ISourceText, IEditWidget -> TextAreaWidget
+    
+        >>> source = fields.SourceText()
+        >>> widget = zapi.getViewProviding(source, IEditWidget, request)
+        >>> isinstance(widget, widgets.TextAreaWidget)
         True
     """
 




More information about the Zope3-Checkins mailing list