[Zope3-checkins] CVS: Zope3/src/zope/schema/tests - test_boolfield.py:1.1.2.2 test_datetime.py:1.1.2.2 test_dictfield.py:1.1.2.2 test_field.py:1.1.2.2 test_floatfield.py:1.1.2.2 test_intfield.py:1.1.2.2 test_listfield.py:1.1.2.2 test_schema.py:1.1.2.2 test_strfield.py:1.1.2.2 test_tuplefield.py:1.1.2.2

Guido van Rossum guido@python.org
Mon, 23 Dec 2002 15:37:34 -0500


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

Modified Files:
      Tag: NameGeddon-branch
	test_boolfield.py test_datetime.py test_dictfield.py 
	test_field.py test_floatfield.py test_intfield.py 
	test_listfield.py test_schema.py test_strfield.py 
	test_tuplefield.py 
Log Message:
Buncha renames.  Schema tests run.

=== Zope3/src/zope/schema/tests/test_boolfield.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/schema/tests/test_boolfield.py:1.1.2.1	Mon Dec 23 14:33:14 2002
+++ Zope3/src/zope/schema/tests/test_boolfield.py	Mon Dec 23 15:37:34 2002
@@ -15,7 +15,8 @@
 $Id$
 """
 from unittest import TestSuite, main, makeSuite
-from zope.schema import Bool, ErrorNames
+from zope.schema import Bool
+from zope.schema.errornames import RequiredMissing
 from zope.schema.tests.test_field import FieldTestBase
 
 class BoolTest(FieldTestBase):
@@ -36,8 +37,7 @@
         field.validate(True)
         field.validate(False)
 
-        self.assertRaisesErrorNames(ErrorNames.RequiredMissing,
-                                    field.validate, None)
+        self.assertRaisesErrorNames(RequiredMissing, field.validate, None)
 
 
 def test_suite():


=== Zope3/src/zope/schema/tests/test_datetime.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/schema/tests/test_datetime.py:1.1.2.1	Mon Dec 23 14:33:14 2002
+++ Zope3/src/zope/schema/tests/test_datetime.py	Mon Dec 23 15:37:34 2002
@@ -15,7 +15,8 @@
 $Id$
 """
 from unittest import TestSuite, main, makeSuite
-from zope.schema import Datetime, ErrorNames
+from zope.schema import Datetime
+from zope.schema import errornames
 from zope.schema.tests.test_field import FieldTestBase
 from datetime import datetime
 
@@ -35,7 +36,7 @@
                     readonly=False, required=True)
         field.validate(datetime.now())
         
-        self.assertRaisesErrorNames(ErrorNames.RequiredMissing,
+        self.assertRaisesErrorNames(errornames.RequiredMissing,
                                     field.validate, None)
 
     def testAllowedValues(self):
@@ -50,7 +51,7 @@
         field.validate(d2)
         field.validate(datetime(2000,10,2))
     
-        self.assertRaisesErrorNames(ErrorNames.InvalidValue,
+        self.assertRaisesErrorNames(errornames.InvalidValue,
                                     field.validate,
                                     datetime(2000,10,4))
 
@@ -64,7 +65,7 @@
         field.validate(d2)
         field.validate(datetime.now())
         
-        self.assertRaisesErrorNames(ErrorNames.TooSmall, field.validate,
+        self.assertRaisesErrorNames(errornames.TooSmall, field.validate,
                                     datetime(2000,9,30))
 
     def testValidateMax(self):
@@ -77,7 +78,7 @@
         field.validate(d1)
         field.validate(d2)
     
-        self.assertRaisesErrorNames(ErrorNames.TooBig, field.validate, d3)
+        self.assertRaisesErrorNames(errornames.TooBig, field.validate, d3)
 
     def testValidateMinAndMax(self):
         d1 = datetime(2000,10,1)
@@ -93,8 +94,8 @@
         field.validate(d3)
         field.validate(d4)
 
-        self.assertRaisesErrorNames(ErrorNames.TooSmall, field.validate, d1)
-        self.assertRaisesErrorNames(ErrorNames.TooBig, field.validate, d5)
+        self.assertRaisesErrorNames(errornames.TooSmall, field.validate, d1)
+        self.assertRaisesErrorNames(errornames.TooBig, field.validate, d5)
 
 
 def test_suite():


=== Zope3/src/zope/schema/tests/test_dictfield.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/schema/tests/test_dictfield.py:1.1.2.1	Mon Dec 23 14:33:14 2002
+++ Zope3/src/zope/schema/tests/test_dictfield.py	Mon Dec 23 15:37:34 2002
@@ -15,7 +15,8 @@
 $Id$
 """
 from unittest import TestSuite, main, makeSuite
-from zope.schema import Dict, Int, Float, ErrorNames
+from zope.schema import Dict, Int, Float
+from zope.schema import errornames
 from zope.schema.tests.test_field import FieldTestBase
 
 class DictTest(FieldTestBase):
@@ -38,7 +39,7 @@
         field.validate({1: 'foo'})
         field.validate({'a': 1})
     
-        self.assertRaisesErrorNames(ErrorNames.RequiredMissing,
+        self.assertRaisesErrorNames(errornames.RequiredMissing,
                                     field.validate, None)
 
     def testValidateMinValues(self):
@@ -49,7 +50,7 @@
         field.validate({1: 'a'})
         field.validate({1: 'a', 2: 'b'})
     
-        self.assertRaisesErrorNames(ErrorNames.TooShort,
+        self.assertRaisesErrorNames(errornames.TooShort,
                                     field.validate, {})
 
     def testValidateMaxValues(self):
@@ -60,9 +61,9 @@
         field.validate({})
         field.validate({1: 'a'})
     
-        self.assertRaisesErrorNames(ErrorNames.TooLong,
+        self.assertRaisesErrorNames(errornames.TooLong,
                                     field.validate, {1: 'a', 2: 'b'})
-        self.assertRaisesErrorNames(ErrorNames.TooLong,
+        self.assertRaisesErrorNames(errornames.TooLong,
                                     field.validate, {1: 'a', 2: 'b', 3: 'c'})
 
     def testValidateMinValuesAndMaxValues(self):
@@ -73,9 +74,9 @@
         field.validate({1: 'a'})
         field.validate({1: 'a', 2: 'b'})
     
-        self.assertRaisesErrorNames(ErrorNames.TooShort,
+        self.assertRaisesErrorNames(errornames.TooShort,
                                     field.validate, {})
-        self.assertRaisesErrorNames(ErrorNames.TooLong,
+        self.assertRaisesErrorNames(errornames.TooLong,
                                     field.validate, {1: 'a', 2: 'b', 3: 'c'})
 
     def testValidateValueTypes(self):
@@ -86,9 +87,9 @@
         field.validate({'a': 5.3})
         field.validate({'a': 2, 'b': 2.3})
         
-        self.assertRaisesErrorNames(ErrorNames.WrongContainedType,
+        self.assertRaisesErrorNames(errornames.WrongContainedType,
                                     field.validate, {1: ''} )
-        self.assertRaisesErrorNames(ErrorNames.WrongContainedType,
+        self.assertRaisesErrorNames(errornames.WrongContainedType,
                                     field.validate, {'a': ()} )
 
     def testValidateKeyTypes(self):
@@ -99,9 +100,9 @@
         field.validate({5.3: 'a'})
         field.validate({2: 'a', 2.3: 'b'})
 
-        self.assertRaisesErrorNames(ErrorNames.WrongContainedType,
+        self.assertRaisesErrorNames(errornames.WrongContainedType,
                                     field.validate, {'': 1} )
-        self.assertRaisesErrorNames(ErrorNames.WrongContainedType,
+        self.assertRaisesErrorNames(errornames.WrongContainedType,
                                     field.validate, {(): 'a'} )
 
 


=== Zope3/src/zope/schema/tests/test_field.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/schema/tests/test_field.py:1.1.2.1	Mon Dec 23 14:33:14 2002
+++ Zope3/src/zope/schema/tests/test_field.py	Mon Dec 23 15:37:34 2002
@@ -15,7 +15,9 @@
 $Id$
 """
 from unittest import TestCase, TestSuite, main, makeSuite
-from zope.schema import Field, Text, IField, ErrorNames, Int
+from zope.schema import Field, Text, Int
+from zope.schema.interfaces import IField
+from zope.schema import errornames
 from zope.schema.interfaces import StopValidation, ValidationError
 
 class FieldTestBase(TestCase):
@@ -64,7 +66,7 @@
         field.validate(0)
         field.validate('')
             
-        self.assertRaisesErrorNames(ErrorNames.RequiredMissing,
+        self.assertRaisesErrorNames(errornames.RequiredMissing,
                                     field.validate, None)
 
 class FieldTest(FieldTestBase):
@@ -116,7 +118,7 @@
                 constraint=isodd)
 
         i.validate(11)
-        self.assertRaisesErrorNames(ErrorNames.ConstraintNotSatisfied,
+        self.assertRaisesErrorNames(errornames.ConstraintNotSatisfied,
                                     i.validate, 10)
         
                            


=== Zope3/src/zope/schema/tests/test_floatfield.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/schema/tests/test_floatfield.py:1.1.2.1	Mon Dec 23 14:33:14 2002
+++ Zope3/src/zope/schema/tests/test_floatfield.py	Mon Dec 23 15:37:34 2002
@@ -15,7 +15,8 @@
 $Id$
 """
 from unittest import TestSuite, main, makeSuite
-from zope.schema import Float, ErrorNames
+from zope.schema import Float
+from zope.schema import errornames
 from zope.schema.tests.test_field import FieldTestBase
 
 class FloatTest(FieldTestBase):
@@ -38,7 +39,7 @@
         field.validate(0.93)
         field.validate(1000.0003)
 
-        self.assertRaisesErrorNames(ErrorNames.RequiredMissing,
+        self.assertRaisesErrorNames(errornames.RequiredMissing,
                                     field.validate, None)        
     def testAllowedValues(self):
         field = Float(title=u'Integer field', description=u'',
@@ -47,7 +48,7 @@
         field.validate(None)
         field.validate(2.6)
 
-        self.assertRaisesErrorNames(ErrorNames.InvalidValue,
+        self.assertRaisesErrorNames(errornames.InvalidValue,
                                     field.validate, -5.4)
 
     def testValidateMin(self):
@@ -57,8 +58,8 @@
         field.validate(10.6)
         field.validate(20.2)
 
-        self.assertRaisesErrorNames(ErrorNames.TooSmall, field.validate, -9.0)
-        self.assertRaisesErrorNames(ErrorNames.TooSmall, field.validate, 10.4)
+        self.assertRaisesErrorNames(errornames.TooSmall, field.validate, -9.0)
+        self.assertRaisesErrorNames(errornames.TooSmall, field.validate, 10.4)
 
     def testValidateMax(self):
         field = Float(title=u'Float field', description=u'',
@@ -67,8 +68,8 @@
         field.validate(5.3)
         field.validate(-9.1)
 
-        self.assertRaisesErrorNames(ErrorNames.TooBig, field.validate, 10.51)
-        self.assertRaisesErrorNames(ErrorNames.TooBig, field.validate, 20.7)
+        self.assertRaisesErrorNames(errornames.TooBig, field.validate, 10.51)
+        self.assertRaisesErrorNames(errornames.TooBig, field.validate, 20.7)
 
     def testValidateMinAndMax(self):
         field = Float(title=u'Float field', description=u'',
@@ -78,10 +79,10 @@
         field.validate(-0.03)
         field.validate(10.0001)
 
-        self.assertRaisesErrorNames(ErrorNames.TooSmall, field.validate, -10.0)
-        self.assertRaisesErrorNames(ErrorNames.TooSmall, field.validate, -1.6)
-        self.assertRaisesErrorNames(ErrorNames.TooBig, field.validate, 11.45)
-        self.assertRaisesErrorNames(ErrorNames.TooBig, field.validate, 20.02)
+        self.assertRaisesErrorNames(errornames.TooSmall, field.validate, -10.0)
+        self.assertRaisesErrorNames(errornames.TooSmall, field.validate, -1.6)
+        self.assertRaisesErrorNames(errornames.TooBig, field.validate, 11.45)
+        self.assertRaisesErrorNames(errornames.TooBig, field.validate, 20.02)
 
 
 def test_suite():


=== Zope3/src/zope/schema/tests/test_intfield.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/schema/tests/test_intfield.py:1.1.2.1	Mon Dec 23 14:33:14 2002
+++ Zope3/src/zope/schema/tests/test_intfield.py	Mon Dec 23 15:37:34 2002
@@ -15,7 +15,8 @@
 $Id$
 """
 from unittest import TestSuite, main, makeSuite
-from zope.schema import Int, ErrorNames
+from zope.schema import Int
+from zope.schema import errornames
 from zope.schema.tests.test_field import FieldTestBase
 
 class IntTest(FieldTestBase):
@@ -38,7 +39,7 @@
         field.validate(0)
         field.validate(-1)
         
-        self.assertRaisesErrorNames(ErrorNames.RequiredMissing,
+        self.assertRaisesErrorNames(errornames.RequiredMissing,
                                     field.validate, None)
 
     def testAllowedValues(self):
@@ -47,7 +48,7 @@
         field.validate(None)
         field.validate(2)
     
-        self.assertRaisesErrorNames(ErrorNames.InvalidValue,
+        self.assertRaisesErrorNames(errornames.InvalidValue,
                                     field.validate, 4)
 
     def testValidateMin(self):
@@ -57,8 +58,8 @@
         field.validate(10)
         field.validate(20)
         
-        self.assertRaisesErrorNames(ErrorNames.TooSmall, field.validate, 9)
-        self.assertRaisesErrorNames(ErrorNames.TooSmall, field.validate, -10)
+        self.assertRaisesErrorNames(errornames.TooSmall, field.validate, 9)
+        self.assertRaisesErrorNames(errornames.TooSmall, field.validate, -10)
 
     def testValidateMax(self):
         field = Int(title=u'Int field', description=u'',
@@ -67,8 +68,8 @@
         field.validate(5)
         field.validate(9)
     
-        self.assertRaisesErrorNames(ErrorNames.TooBig, field.validate, 11)
-        self.assertRaisesErrorNames(ErrorNames.TooBig, field.validate, 20)
+        self.assertRaisesErrorNames(errornames.TooBig, field.validate, 11)
+        self.assertRaisesErrorNames(errornames.TooBig, field.validate, 20)
 
     def testValidateMinAndMax(self):
         field = Int(title=u'Int field', description=u'',
@@ -78,10 +79,10 @@
         field.validate(5)
         field.validate(10)
 
-        self.assertRaisesErrorNames(ErrorNames.TooSmall, field.validate, -10)
-        self.assertRaisesErrorNames(ErrorNames.TooSmall, field.validate, -1)
-        self.assertRaisesErrorNames(ErrorNames.TooBig, field.validate, 11)
-        self.assertRaisesErrorNames(ErrorNames.TooBig, field.validate, 20)
+        self.assertRaisesErrorNames(errornames.TooSmall, field.validate, -10)
+        self.assertRaisesErrorNames(errornames.TooSmall, field.validate, -1)
+        self.assertRaisesErrorNames(errornames.TooBig, field.validate, 11)
+        self.assertRaisesErrorNames(errornames.TooBig, field.validate, 20)
 
 
 def test_suite():


=== Zope3/src/zope/schema/tests/test_listfield.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/schema/tests/test_listfield.py:1.1.2.1	Mon Dec 23 14:33:14 2002
+++ Zope3/src/zope/schema/tests/test_listfield.py	Mon Dec 23 15:37:34 2002
@@ -15,7 +15,8 @@
 $Id$
 """
 from unittest import TestSuite, main, makeSuite
-from zope.schema import List, Int, Float, ErrorNames
+from zope.schema import List, Int, Float
+from zope.schema import errornames
 from zope.schema.tests.test_field import FieldTestBase
 
 class ListTest(FieldTestBase):
@@ -38,7 +39,7 @@
         field.validate([1, 2])
         field.validate([3,])
             
-        self.assertRaisesErrorNames(ErrorNames.RequiredMissing,
+        self.assertRaisesErrorNames(errornames.RequiredMissing,
                                     field.validate, None)
 
     def testValidateMinValues(self):
@@ -48,9 +49,9 @@
         field.validate([1, 2])
         field.validate([1, 2, 3])
     
-        self.assertRaisesErrorNames(ErrorNames.TooShort,
+        self.assertRaisesErrorNames(errornames.TooShort,
                                     field.validate, [])
-        self.assertRaisesErrorNames(ErrorNames.TooShort,
+        self.assertRaisesErrorNames(errornames.TooShort,
                                     field.validate, [1,])
 
     def testValidateMaxValues(self):
@@ -60,9 +61,9 @@
         field.validate([])
         field.validate([1, 2])
     
-        self.assertRaisesErrorNames(ErrorNames.TooLong,
+        self.assertRaisesErrorNames(errornames.TooLong,
                                     field.validate, [1, 2, 3, 4])
-        self.assertRaisesErrorNames(ErrorNames.TooLong,
+        self.assertRaisesErrorNames(errornames.TooLong,
                                     field.validate, [1, 2, 3])
 
     def testValidateMinValuesAndMaxValues(self):
@@ -73,9 +74,9 @@
         field.validate([1, ])
         field.validate([1, 2])
 
-        self.assertRaisesErrorNames(ErrorNames.TooShort,
+        self.assertRaisesErrorNames(errornames.TooShort,
                                     field.validate, [])
-        self.assertRaisesErrorNames(ErrorNames.TooLong,
+        self.assertRaisesErrorNames(errornames.TooLong,
                                     field.validate, [1, 2, 3])
 
     def testValidateValueTypes(self):
@@ -86,9 +87,9 @@
         field.validate([5.3,])
         field.validate([2, 2.3])
 
-        self.assertRaisesErrorNames(ErrorNames.WrongContainedType,
+        self.assertRaisesErrorNames(errornames.WrongContainedType,
                                     field.validate, ['',] )
-        self.assertRaisesErrorNames(ErrorNames.WrongContainedType,
+        self.assertRaisesErrorNames(errornames.WrongContainedType,
                                     field.validate, [2, ''] )
 
 def test_suite():


=== Zope3/src/zope/schema/tests/test_schema.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/schema/tests/test_schema.py:1.1.2.1	Mon Dec 23 14:33:14 2002
+++ Zope3/src/zope/schema/tests/test_schema.py	Mon Dec 23 15:37:34 2002
@@ -18,7 +18,8 @@
 from zope.schema.interfaces import StopValidation, ValidationError, \
      ValidationErrorsAll
 from zope.interface import Interface
-from zope.schema import Bytes, ErrorNames
+from zope.schema import Bytes
+from zope.schema.errornames import RequiredMissing
 from zope.schema import validateMapping, validateMappingAll,\
      getFields, getFieldsInOrder
 
@@ -71,7 +72,7 @@
         try:
             validateMappingAll(ISchemaTest, dict)
         except ValidationErrorsAll, e:
-            error=ValidationError(ErrorNames.RequiredMissing)
+            error=ValidationError(RequiredMissing)
             self.assertEqual(e.errors ,
                              [('description',error), ('spam',error)])
             self.assertRaises(ValidationError, validateMapping, ISchemaTest,


=== Zope3/src/zope/schema/tests/test_strfield.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/schema/tests/test_strfield.py:1.1.2.1	Mon Dec 23 14:33:14 2002
+++ Zope3/src/zope/schema/tests/test_strfield.py	Mon Dec 23 15:37:34 2002
@@ -15,7 +15,8 @@
 $Id$
 """
 from unittest import TestSuite, main, makeSuite
-from zope.schema import Bytes, BytesLine, Text, TextLine, ErrorNames
+from zope.schema import Bytes, BytesLine, Text, TextLine
+from zope.schema import errornames
 from zope.schema.interfaces import ValidationError 
 from zope.schema.tests.test_field import FieldTestBase
 
@@ -39,9 +40,9 @@
             readonly=False, required=True, min_length=1)
         field.validate(self._convert('foo'))
 
-        self.assertRaisesErrorNames(ErrorNames.RequiredMissing,
+        self.assertRaisesErrorNames(errornames.RequiredMissing,
                                     field.validate, None)
-        self.assertRaisesErrorNames(ErrorNames.TooShort,
+        self.assertRaisesErrorNames(errornames.TooShort,
                                     field.validate, self._convert(''))
 
     def testAllowedValues(self):
@@ -53,7 +54,7 @@
         field.validate(None)
         field.validate(self._convert('foo'))
 
-        self.assertRaisesErrorNames(ErrorNames.InvalidValue,
+        self.assertRaisesErrorNames(errornames.InvalidValue,
                                     field.validate, self._convert('blah'))
 
     def testValidateMinLength(self):
@@ -64,11 +65,11 @@
         field.validate(self._convert('333'))
         field.validate(self._convert('55555'))
 
-        self.assertRaisesErrorNames(ErrorNames.TooShort,
+        self.assertRaisesErrorNames(errornames.TooShort,
                                     field.validate, self._convert(''))
-        self.assertRaisesErrorNames(ErrorNames.TooShort,
+        self.assertRaisesErrorNames(errornames.TooShort,
                                     field.validate, self._convert('22'))
-        self.assertRaisesErrorNames(ErrorNames.TooShort,
+        self.assertRaisesErrorNames(errornames.TooShort,
                                     field.validate, self._convert('1'))
 
     def testValidateMaxLength(self):
@@ -80,9 +81,9 @@
         field.validate(self._convert('333'))
         field.validate(self._convert('55555'))
 
-        self.assertRaisesErrorNames(ErrorNames.TooLong, field.validate,
+        self.assertRaisesErrorNames(errornames.TooLong, field.validate,
                                     self._convert('666666'))
-        self.assertRaisesErrorNames(ErrorNames.TooLong, field.validate,
+        self.assertRaisesErrorNames(errornames.TooLong, field.validate,
                                     self._convert('999999999'))
 
     def testValidateMinLengthAndMaxLength(self):
@@ -96,13 +97,13 @@
         field.validate(self._convert('4444'))
         field.validate(self._convert('55555'))
         
-        self.assertRaisesErrorNames(ErrorNames.TooShort,
+        self.assertRaisesErrorNames(errornames.TooShort,
                                     field.validate, self._convert('22'))
-        self.assertRaisesErrorNames(ErrorNames.TooShort,
+        self.assertRaisesErrorNames(errornames.TooShort,
                                     field.validate, self._convert('22'))
-        self.assertRaisesErrorNames(ErrorNames.TooLong, field.validate,
+        self.assertRaisesErrorNames(errornames.TooLong, field.validate,
                                     self._convert('666666'))
-        self.assertRaisesErrorNames(ErrorNames.TooLong, field.validate,
+        self.assertRaisesErrorNames(errornames.TooLong, field.validate,
                                     self._convert('999999999'))
 
 
@@ -135,7 +136,7 @@
 
     def test_newlines(self):
         field = self._Field_Factory(title=u'Str field')
-        self.assertRaisesErrorNames(ErrorNames.ConstraintNotSatisfied,
+        self.assertRaisesErrorNames(errornames.ConstraintNotSatisfied,
                                     field.validate,
                                     self._convert('hello\nworld'))    
 


=== Zope3/src/zope/schema/tests/test_tuplefield.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/schema/tests/test_tuplefield.py:1.1.2.1	Mon Dec 23 14:33:14 2002
+++ Zope3/src/zope/schema/tests/test_tuplefield.py	Mon Dec 23 15:37:34 2002
@@ -15,7 +15,8 @@
 $Id$
 """
 from unittest import TestSuite, main, makeSuite
-from zope.schema import Tuple, Int, Float, ErrorNames
+from zope.schema import Tuple, Int, Float
+from zope.schema import errornames
 from zope.schema.tests.test_field import FieldTestBase
 
 class TupleTest(FieldTestBase):
@@ -38,7 +39,7 @@
         field.validate((1, 2))
         field.validate((3,))
 
-        self.assertRaisesErrorNames(ErrorNames.RequiredMissing,
+        self.assertRaisesErrorNames(errornames.RequiredMissing,
                                     field.validate, None)
 
     def testValidateMinValues(self):
@@ -48,9 +49,9 @@
         field.validate((1, 2))
         field.validate((1, 2, 3))
 
-        self.assertRaisesErrorNames(ErrorNames.TooShort,
+        self.assertRaisesErrorNames(errornames.TooShort,
                                     field.validate, ())
-        self.assertRaisesErrorNames(ErrorNames.TooShort,
+        self.assertRaisesErrorNames(errornames.TooShort,
                                     field.validate, (1,))
 
     def testValidateMaxValues(self):
@@ -60,9 +61,9 @@
         field.validate(())
         field.validate((1, 2))
 
-        self.assertRaisesErrorNames(ErrorNames.TooLong,
+        self.assertRaisesErrorNames(errornames.TooLong,
                                     field.validate, (1, 2, 3, 4))
-        self.assertRaisesErrorNames(ErrorNames.TooLong,
+        self.assertRaisesErrorNames(errornames.TooLong,
                                     field.validate, (1, 2, 3))
 
     def testValidateMinValuesAndMaxValues(self):
@@ -73,9 +74,9 @@
         field.validate((1, ))
         field.validate((1, 2))
 
-        self.assertRaisesErrorNames(ErrorNames.TooShort,
+        self.assertRaisesErrorNames(errornames.TooShort,
                                     field.validate, ())
-        self.assertRaisesErrorNames(ErrorNames.TooLong,
+        self.assertRaisesErrorNames(errornames.TooLong,
                                     field.validate, (1, 2, 3))
 
     def testValidateValueTypes(self):
@@ -86,9 +87,9 @@
         field.validate((5.3,))
         field.validate((2, 2.3))
 
-        self.assertRaisesErrorNames(ErrorNames.WrongContainedType,
+        self.assertRaisesErrorNames(errornames.WrongContainedType,
                                     field.validate, ('',) )
-        self.assertRaisesErrorNames(ErrorNames.WrongContainedType,
+        self.assertRaisesErrorNames(errornames.WrongContainedType,
                                     field.validate, (2, '') )
 
 def test_suite():