[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form/ftests -
test_filewidget.py:1.4.14.2 test_registrations.py:1.1.4.2
Garrett Smith
garrett at mojave-corp.com
Mon Mar 1 18:33:38 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/browser/form/ftests
In directory cvs.zope.org:/tmp/cvs-serv27606/src/zope/app/browser/form/ftests
Modified Files:
Tag: garrett-widgets2-branch
test_filewidget.py test_registrations.py
Log Message:
Changes related to widget machinery:
- Added source argument to setUpEditWidgets and setUpDisplayWidgets.
- Renamed IEditWidget to IInputWidget.
- Added a widgetsData attribute to zope.app.interfaces.formWidgetsError.
=== Zope3/src/zope/app/browser/form/ftests/test_filewidget.py 1.4.14.1 => 1.4.14.2 ===
--- Zope3/src/zope/app/browser/form/ftests/test_filewidget.py:1.4.14.1 Thu Feb 26 00:10:50 2004
+++ Zope3/src/zope/app/browser/form/ftests/test_filewidget.py Mon Mar 1 18:33:07 2004
@@ -33,7 +33,7 @@
from zope.app.traversing import traverse
from zope.testing.functional import BrowserTestCase
-from zope.app.interfaces.form import IEditWidget
+from zope.app.interfaces.form import IInputWidget
class IFileField(IEnumerated, IField):
"""Field for representing a file that can be edited by FileWidget."""
@@ -44,7 +44,7 @@
implements(IFileField)
-defineWidgetView(IFileField, FileWidget, IEditWidget)
+defineWidgetView(IFileField, FileWidget, IInputWidget)
class IFileTest(Interface):
=== Zope3/src/zope/app/browser/form/ftests/test_registrations.py 1.1.4.1 => 1.1.4.2 ===
--- Zope3/src/zope/app/browser/form/ftests/test_registrations.py:1.1.4.1 Thu Feb 26 00:10:50 2004
+++ Zope3/src/zope/app/browser/form/ftests/test_registrations.py Mon Mar 1 18:33:07 2004
@@ -13,7 +13,7 @@
from zope.app.browser.form import enumerated
from zope.app.interfaces.form import IDisplayWidget
-from zope.app.interfaces.form import IEditWidget
+from zope.app.interfaces.form import IInputWidget
class ISampleObject(interfaces.IField):
@@ -57,136 +57,136 @@
>>> isinstance(widget, widgets.DisplayWidget)
True
- ITextLine, IEditWidget -> TextWidget
+ ITextLine, IInputWidget -> TextWidget
>>> field = fields.TextLine()
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, widgets.TextWidget)
True
- IText, IEditWidget -> TextAreaWidget
+ IText, IInputWidget -> TextAreaWidget
>>> field = fields.Text()
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, widgets.TextAreaWidget)
True
- ISourceText, IEditWidget -> TextAreaWidget
+ ISourceText, IInputWidget -> TextAreaWidget
>>> field = fields.SourceText()
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, widgets.TextAreaWidget)
True
- IBytesLine, IEditWidget -> BytesWidget
+ IBytesLine, IInputWidget -> BytesWidget
>>> field = fields.BytesLine()
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, widgets.BytesWidget)
True
- IBytes, IEditWidget -> FileWidget
+ IBytes, IInputWidget -> FileWidget
>>> field = fields.Bytes()
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, widgets.FileWidget)
True
- IASCII, IEditWidget -> BytesAreaWidget
+ IASCII, IInputWidget -> BytesAreaWidget
>>> field = fields.ASCII()
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, widgets.BytesAreaWidget)
True
- IInt, IEditWidget -> IntWidget
+ IInt, IInputWidget -> IntWidget
>>> field = fields.Int()
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, widgets.IntWidget)
True
- IFloat, IEditWidget -> FloatWidget
+ IFloat, IInputWidget -> FloatWidget
>>> field = fields.Float()
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, widgets.FloatWidget)
True
- IDatetime, IEditWidget -> DatetimeWidget
+ IDatetime, IInputWidget -> DatetimeWidget
>>> field = fields.Datetime()
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, widgets.DatetimeWidget)
True
- IDate, IEditWidget -> DateWidget
+ IDate, IInputWidget -> DateWidget
>>> field = fields.Date()
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, widgets.DateWidget)
True
- IBool, IEditWidget -> CheckBoxWidget
+ IBool, IInputWidget -> CheckBoxWidget
>>> field = fields.Bool()
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, widgets.CheckBoxWidget)
True
- ITuple, IEditWidget -> TupleSequenceWidget
+ ITuple, IInputWidget -> TupleSequenceWidget
>>> field = fields.Tuple()
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, widgets.TupleSequenceWidget)
True
- IList, IEditWidget -> ListSequenceWidget
+ IList, IInputWidget -> ListSequenceWidget
>>> field = fields.List()
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, widgets.ListSequenceWidget)
True
- IPassword, IEditWidget -> PasswordWidget
+ IPassword, IInputWidget -> PasswordWidget
>>> field = fields.Password()
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, widgets.PasswordWidget)
True
- IEnumeratedTextLine, IEditWidget -> EnumeratedTextWidget
+ IEnumeratedTextLine, IInputWidget -> EnumeratedTextWidget
>>> field = fields.EnumeratedTextLine()
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, enumerated.EnumeratedTextWidget)
True
- IEnumeratedInt, IEditWidget -> EnumeratedIntWidget
+ IEnumeratedInt, IInputWidget -> EnumeratedIntWidget
>>> field = fields.EnumeratedInt()
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, enumerated.EnumeratedIntWidget)
True
- IEnumeratedFloat, IEditWidget -> EnumeratedFloatWidget
+ IEnumeratedFloat, IInputWidget -> EnumeratedFloatWidget
>>> field = fields.EnumeratedFloat()
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, enumerated.EnumeratedFloatWidget)
True
- IEnumeratedDatetime, IEditWidget -> EnumeratedDatetimeWidget
+ IEnumeratedDatetime, IInputWidget -> EnumeratedDatetimeWidget
>>> field = fields.EnumeratedDatetime()
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, enumerated.EnumeratedDatetimeWidget)
True
- IEnumeratedDate, IEditWidget -> EnumeratedDateWidget
+ IEnumeratedDate, IInputWidget -> EnumeratedDateWidget
>>> field = fields.EnumeratedDate()
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, enumerated.EnumeratedDateWidget)
True
@@ -195,8 +195,7 @@
------------------------------------------------------------------------
The relationships between vocabulary fields and widgets are listed
below. Note that the actual widgets returned are for IVocabulary object,
- not IVocabularyField objects. This is counterintuitive given a reading
- of configure.zcml. (XXX this should be cleaned up)
+ not IVocabularyField objects.
IVocabularyField, IDisplayWidget -> VocabularyDisplayWidget
@@ -205,12 +204,12 @@
>>> widget = zapi.getViewProviding(field, IDisplayWidget, request)
>>> isinstance(widget, vocabwidgets.VocabularyDisplayWidget)
True
-
- IVocabularyField, IEditWidget = VocabularyEditWidget
+
+ IVocabularyField, IInputWidget = VocabularyEditWidget
>>> field = vocabulary.VocabularyField(vocab)
>>> field = field.bind(sample)
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, vocabwidgets.VocabularyEditWidget)
True
@@ -222,14 +221,6 @@
>>> isinstance(widget, vocabwidgets.VocabularyBagDisplayWidget)
True
- IVocabularyBagField, IEditWidget -> VocabularyMultiEditWidget
-
- >>> field = vocabulary.VocabularyBagField(vocabulary=vocab)
- >>> field = field.bind(sample)
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
- >>> isinstance(widget, vocabwidgets.VocabularyMultiEditWidget)
- True
-
IVocabularyListField, IDisplayWidget -> VocabularyListDisplayWidget
>>> field = vocabulary.VocabularyListField(vocabulary=vocab)
@@ -238,11 +229,11 @@
>>> isinstance(widget, vocabwidgets.VocabularyListDisplayWidget)
True
- IVocabularyListField, IEditWidget -> VocabularyListEditWidget
+ IVocabularyListField, IInputWidget -> VocabularyListEditWidget
>>> field = vocabulary.VocabularyListField(vocabulary=vocab)
>>> field = field.bind(sample)
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
+ >>> widget = zapi.getViewProviding(field, IInputWidget, request)
>>> isinstance(widget, vocabwidgets.VocabularyMultiEditWidget)
True
@@ -254,14 +245,6 @@
>>> isinstance(widget, vocabwidgets.VocabularyBagDisplayWidget)
True
- IVocabularySetField, IEditWidget -> VocabularyMultiEditWidget
-
- >>> field = vocabulary.VocabularySetField(vocabulary=vocab)
- >>> field = field.bind(sample)
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
- >>> isinstance(widget, vocabwidgets.VocabularyMultiEditWidget)
- True
-
IVocabularyUniqueListField, IDisplayWidget -> VocabularyListDisplayWidget
>>> field = vocabulary.VocabularyUniqueListField(vocabulary=vocab)
@@ -269,16 +252,8 @@
>>> widget = zapi.getViewProviding(field, IDisplayWidget, request)
>>> isinstance(widget, vocabwidgets.VocabularyListDisplayWidget)
True
-
- IVocabularyUniqueListField, IEditWidget -> VocabularyMultiEditWidget
-
- >>> field = vocabulary.VocabularyUniqueListField(vocabulary=vocab)
- >>> field = field.bind(sample)
- >>> widget = zapi.getViewProviding(field, IEditWidget, request)
- >>> isinstance(widget, vocabwidgets.VocabularyMultiEditWidget)
- True
+
"""
-
def test_suite():
return doctest.DocTestSuite()
More information about the Zope3-Checkins
mailing list