[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form/tests - test_vocabularywidget.py:1.1.2.16

Fred L. Drake, Jr. fred@zope.com
Fri, 9 May 2003 10:02:05 -0400


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

Modified Files:
      Tag: schema-vocabulary-branch
	test_vocabularywidget.py 
Log Message:
reflect the move of the interfaces


=== Zope3/src/zope/app/browser/form/tests/test_vocabularywidget.py 1.1.2.15 => 1.1.2.16 ===
--- Zope3/src/zope/app/browser/form/tests/test_vocabularywidget.py:1.1.2.15	Tue May  6 15:49:27 2003
+++ Zope3/src/zope/app/browser/form/tests/test_vocabularywidget.py	Fri May  9 10:02:04 2003
@@ -24,15 +24,17 @@
 from zope.publisher.browser import TestRequest
 from zope.publisher.interfaces.browser import IBrowserPresentation
 
+from zope.schema.interfaces import IVocabulary, ITerm
+from zope.schema.interfaces import IVocabularyField, IVocabularyMultiField
 from zope.schema import vocabulary
 
 
-class ISampleVocabulary(vocabulary.IVocabulary):
+class ISampleVocabulary(IVocabulary):
     """Specialized interface so we can hook views onto a vocabulary."""
 
 class SampleTerm(object):
     """Trivial ITerm implementation."""
-    __implements__ = vocabulary.ITerm
+    __implements__ = ITerm
 
     def __init__(self, value):
         self.value = value
@@ -40,7 +42,7 @@
 
 class BasicVocabulary(object):
     """Simple vocabulary that uses terms from a passed-in list of values."""
-    __implements__ = vocabulary.IVocabulary
+    __implements__ = IVocabulary
 
     def __init__(self, values):
         self._values = values
@@ -131,20 +133,20 @@
     def registerViews(self):
         # This is equivalent to the default configuration for
         # vocabulary field view registration from configure.zcml.
-        provideView(vocabulary.IVocabularyField,
+        provideView(IVocabularyField,
                     "display",
                     IBrowserPresentation,
                     widget.VocabularyFieldDisplayWidget)
-        provideView(vocabulary.IVocabularyField,
+        provideView(IVocabularyField,
                     "edit",
                     IBrowserPresentation,
                     widget.VocabularyFieldEditWidget)
         # Register the "basic" widgets:
-        provideView(vocabulary.IVocabulary,
+        provideView(IVocabulary,
                     "field-display-widget",
                     IBrowserPresentation,
                     widget.VocabularyDisplayWidget)
-        provideView(vocabulary.IVocabulary,
+        provideView(IVocabulary,
                     "field-edit-widget",
                     IBrowserPresentation,
                     widget.VocabularyEditWidget)
@@ -219,20 +221,20 @@
     def registerViews(self):
         # This is equivalent to the default configuration for
         # vocabulary field view registration from configure.zcml.
-        provideView(vocabulary.IVocabularyMultiField,
+        provideView(IVocabularyMultiField,
                     "display",
                     IBrowserPresentation,
                     widget.VocabularyMultiFieldDisplayWidget)
-        provideView(vocabulary.IVocabularyMultiField,
+        provideView(IVocabularyMultiField,
                     "edit",
                     IBrowserPresentation,
                     widget.VocabularyMultiFieldEditWidget)
         # Bind widgets to the vocabulary fields:
-        provideView(vocabulary.IVocabulary,
+        provideView(IVocabulary,
                     "field-display-multi-widget",
                     IBrowserPresentation,
                     widget.VocabularyMultiDisplayWidget)
-        provideView(vocabulary.IVocabulary,
+        provideView(IVocabulary,
                     "field-edit-multi-widget",
                     IBrowserPresentation,
                     widget.VocabularyMultiEditWidget)