[Zope3-checkins] CVS: Zope3/src/zope/app/schema/tests - keywords_vocab.zcml:1.2 simple_vocab.zcml:1.2 test_directives.py:1.3 test_fieldfactory.py:1.4

Stephan Richter srichter at cosmos.phy.tufts.edu
Wed Mar 3 17:54:28 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/schema/tests
In directory cvs.zope.org:/tmp/cvs-serv20406/src/zope/app/schema/tests

Modified Files:
	keywords_vocab.zcml simple_vocab.zcml test_directives.py 
	test_fieldfactory.py 
Log Message:


The Zope Vocabulary Registry now uses utilities for the vocabulary factories.


=== Zope3/src/zope/app/schema/tests/keywords_vocab.zcml 1.1 => 1.2 ===
--- Zope3/src/zope/app/schema/tests/keywords_vocab.zcml:1.1	Fri Aug  1 17:48:38 2003
+++ Zope3/src/zope/app/schema/tests/keywords_vocab.zcml	Wed Mar  3 17:54:27 2004
@@ -4,7 +4,7 @@
 
   <vocabulary
       name="my-vocab"
-      factory="zope.app.schema.tests.test_vocabulary.MyFactory"
+      factory="zope.app.schema.tests.test_directives.MyFactory"
       filter="my-filter"
       another="keyword"/>
 


=== Zope3/src/zope/app/schema/tests/simple_vocab.zcml 1.1 => 1.2 ===
--- Zope3/src/zope/app/schema/tests/simple_vocab.zcml:1.1	Fri Aug  1 17:48:38 2003
+++ Zope3/src/zope/app/schema/tests/simple_vocab.zcml	Wed Mar  3 17:54:27 2004
@@ -4,6 +4,6 @@
 
   <vocabulary
       name="my-vocab"
-      factory="zope.app.schema.tests.test_vocabulary.MyFactory" />
+      factory="zope.app.schema.tests.test_directives.MyFactory" />
 
 </configure>


=== Zope3/src/zope/app/schema/tests/test_directives.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/schema/tests/test_directives.py:1.2	Sun Aug 17 02:07:58 2003
+++ Zope3/src/zope/app/schema/tests/test_directives.py	Wed Mar  3 17:54:27 2004
@@ -17,13 +17,19 @@
 """
 import unittest
 
-from zope.component.tests.placelesssetup import PlacelessSetup
+from zope.app.tests.placelesssetup import PlacelessSetup
 from zope.configuration import xmlconfig
-from zope.app.schema import vocabulary
+from zope.app.schema.vocabulary import ZopeVocabularyRegistry
 
 import zope.app.schema
 
 
+class MyFactory:
+    def __init__(self, context, **kw):
+        self.ob = context
+        self.kw = kw
+
+
 class DirectivesTest(PlacelessSetup, unittest.TestCase):
 
     extra_keywords = {"filter": "my-filter",
@@ -31,7 +37,8 @@
 
     def check_vocabulary_get(self, kw={}):
         context = object()
-        vocab = vocabulary.vocabularyService.get(context, "my-vocab")
+        registry = ZopeVocabularyRegistry()
+        vocab = registry.get(context, "my-vocab")
         self.assert_(vocab.ob is context)
         self.assertEqual(vocab.kw, kw)
 


=== Zope3/src/zope/app/schema/tests/test_fieldfactory.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/schema/tests/test_fieldfactory.py:1.3	Thu Nov 27 08:59:25 2003
+++ Zope3/src/zope/app/schema/tests/test_fieldfactory.py	Wed Mar  3 17:54:27 2004
@@ -11,11 +11,10 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""
+"""Field Factory Tests
 
 $Id$
 """
-
 import unittest
 
 import zope.app.schema
@@ -40,7 +39,8 @@
                                  zope.app.schema)
 
     def testRegisterFields(self):
-        factory = getService(None, Factories).getFactory('zope.schema._bootstrapfields.Text')
+        factory = getService(None, Factories).getFactory(
+            'zope.schema._bootstrapfields.Text')
         self.assertEquals(factory.title, "Text Field")
         self.assertEquals(factory.description, "Text Field")
 




More information about the Zope3-Checkins mailing list