[Checkins] SVN: zope.schema/trunk/src/zope/schema/ advertise field name in RequiredMissing

Godefroid Chapelle gotcha at bubblenet.be
Mon Nov 30 09:57:31 EST 2009


Log message for revision 106120:
  advertise field name in RequiredMissing
  whitespace
  

Changed:
  U   zope.schema/trunk/src/zope/schema/_bootstrapfields.py
  U   zope.schema/trunk/src/zope/schema/tests/test_objectfield.py

-=-
Modified: zope.schema/trunk/src/zope/schema/_bootstrapfields.py
===================================================================
--- zope.schema/trunk/src/zope/schema/_bootstrapfields.py	2009-11-30 13:49:00 UTC (rev 106119)
+++ zope.schema/trunk/src/zope/schema/_bootstrapfields.py	2009-11-30 14:57:31 UTC (rev 106120)
@@ -134,7 +134,7 @@
     def validate(self, value):
         if value == self.missing_value:
             if self.required:
-                raise RequiredMissing
+                raise RequiredMissing(self.__name__)
         else:
             try:
                 self._validate(value)

Modified: zope.schema/trunk/src/zope/schema/tests/test_objectfield.py
===================================================================
--- zope.schema/trunk/src/zope/schema/tests/test_objectfield.py	2009-11-30 13:49:00 UTC (rev 106119)
+++ zope.schema/trunk/src/zope/schema/tests/test_objectfield.py	2009-11-30 14:57:31 UTC (rev 106120)
@@ -59,7 +59,7 @@
     _attribute = u''
 
     def getfoo(self):
-        return self._foo 
+        return self._foo
 
     def setfoo(self, value):
         self._foo = value
@@ -67,7 +67,7 @@
     foo = property(getfoo, setfoo, None, u'foo')
 
     def getbar(self):
-        return self._bar 
+        return self._bar
 
     def setbar(self, value):
         self._bar = value
@@ -75,7 +75,7 @@
     bar = property(getbar, setbar, None, u'foo')
 
     def getattribute(self):
-        return self._attribute 
+        return self._attribute
 
     def setattribute(self, value):
         self._attribute = value
@@ -110,9 +110,9 @@
         except WrongContainedType, e:
             try:
                 return e[0]
-            except:  
+            except:
                 return []
-        self.fail('Expected WrongContainedType Error')    
+        self.fail('Expected WrongContainedType Error')
 
     def makeTestObject(self, **kw):
         kw['schema'] = kw.get('schema', Interface)
@@ -166,7 +166,7 @@
         self.assertRaises(ValidationError, field.validate, data)
         self.assertRaises(WrongContainedType, field.validate, data)
         errors = self.getErrors(field.validate, data)
-        self.assertEquals(errors[0], RequiredMissing())
+        self.assertEquals(errors[0], RequiredMissing('foo'))
 
     def test_validate_FieldPropertyTestData(self):
         field = self.makeTestObject(schema=ITestSchema, required=False)



More information about the checkins mailing list