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

Fred L. Drake, Jr. fred@zope.com
Fri, 6 Jun 2003 11:17:18 -0400


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

Modified Files:
	test_vocabularywidget.py 
Log Message:
Simplify some of the support code.


=== Zope3/src/zope/app/browser/form/tests/test_vocabularywidget.py 1.19 => 1.20 ===
--- Zope3/src/zope/app/browser/form/tests/test_vocabularywidget.py:1.19	Fri Jun  6 10:46:35 2003
+++ Zope3/src/zope/app/browser/form/tests/test_vocabularywidget.py	Fri Jun  6 11:17:18 2003
@@ -79,8 +79,12 @@
         self.vocabulary = vocabulary
 
 
-class MyQueryViewBase(vocabularywidget.VocabularyQueryViewBase):
-    """Base class for test query views."""
+class MyQueryViewSingle(vocabularywidget.VocabularyQueryViewBase):
+    """Single-selection vocabulary query view."""
+
+    implements(IVocabularyQueryView)
+
+    label = "single"
 
     def getResults(self):
         return self.request.form.get(self.name)
@@ -92,22 +96,10 @@
         return "query-results-go-here"
 
 
-class MyQueryViewSingle(MyQueryViewBase):
-    """Single-selection vocabulary query view."""
-
-    implements(IVocabularyQueryView)
-
-    def getLabel(self):
-        return "single"
-
-
-class MyQueryViewMulti(MyQueryViewBase):
+class MyQueryViewMulti(MyQueryViewSingle):
     """Multi-selection vocabulary query view."""
 
-    implements(IVocabularyQueryView)
-
-    def getLabel(self):
-        return "multi"
+    label = "multi"
 
 
 class VocabularyWidgetTestBase(PlacelessSetup,
@@ -436,7 +428,7 @@
         w = getView(bound, "edit", request)
         self.assert_(isinstance(w.query, MyVocabularyQuery))
         self.assertEqual(w.queryview.name, w.name + "-query")
-        self.assertEqual(w.queryview.getLabel(), self.queryViewLabel)
+        self.assertEqual(w.queryview.label, self.queryViewLabel)
 
     def test_query_input_section(self):
         bound = self.makeField()