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

Fred L. Drake, Jr. fred@zope.com
Wed, 28 May 2003 13:17:57 -0400


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

Modified Files:
	test_vocabularywidget.py 
Log Message:
Fix the getTermByToken() implementation.


=== Zope3/src/zope/app/browser/form/tests/test_vocabularywidget.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/form/tests/test_vocabularywidget.py:1.5	Wed May 28 13:09:02 2003
+++ Zope3/src/zope/app/browser/form/tests/test_vocabularywidget.py	Wed May 28 13:17:57 2003
@@ -69,9 +69,9 @@
         raise LookupError("%r not a vocabulary member" % value)
 
     def getTermByToken(self, token):
-        for term in self._values:
-            if term.token == token:
-                return term
+        # XXX tokens are currently the same as the values:
+        if token in self._values:
+            return SampleTerm(token)
         raise LookupError("token %r not found in vocabulary" % token)
 
 class BasicIterator(object):