Index: main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_converters.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_converters.py	(revision 14004)
+++ main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_converters.py	(revision 14005)
@@ -40,7 +40,6 @@
 from waeup.kofa.university import Faculty
 from waeup.kofa.utils.converters import (
-    IObjectConverter, IFieldConverter, DefaultFieldConverter,
-    ListFieldConverter, PhoneNumberFieldConverter, ResultEntryConverter,
-    DefaultObjectConverter)
+    IObjectConverter, DefaultFieldConverter, ListFieldConverter,
+    PhoneNumberFieldConverter, ResultEntryConverter, DefaultObjectConverter)
 from waeup.kofa.utils.helpers import attrs_to_fields
 
@@ -56,58 +55,62 @@
     ('Three', 3),
     )
+
+
 class IContact(Interface):
     """Sample interface for sample content type used here in tests.
     """
     name = schema.TextLine(
-        title = u'Name',
-        default = u'Manfred',
-        readonly = True,
+        title=u'Name',
+        default=u'Manfred',
+        readonly=True,
         )
     age = schema.Int(
-        title = u'Age',
-        default = 23,
-        required = True,
+        title=u'Age',
+        default=23,
+        required=True,
         )
     city = schema.TextLine(
-        title = u'City',
-        required = True,
+        title=u'City',
+        required=True,
         )
     vip = schema.Bool(
-        title = u'Celebrity',
-        default = False,
-        required = True,
+        title=u'Celebrity',
+        default=False,
+        required=True,
         )
     birthday = schema.Date(
-        title = u'Birthday',
-        default = None,
+        title=u'Birthday',
+        default=None,
         )
     fav_color = schema.Choice(
-        title = u'Favourite color',
-        default = u'red',
-        vocabulary = colors,
+        title=u'Favourite color',
+        default=u'red',
+        vocabulary=colors,
         )
     num_cars = schema.Choice(
-        title = u'Number of cars owned',
-        default = None,
-        vocabulary = car_nums,
+        title=u'Number of cars owned',
+        default=None,
+        vocabulary=car_nums,
         )
     grades = schema.List(
-        title = u'School Grades',
-        value_type = ResultEntryField(),
-        required = True,
-        default = [],
+        title=u'School Grades',
+        value_type=ResultEntryField(),
+        required=True,
+        #defaultFactory=list,
+        default=[],
         )
     fav_colors = schema.List(
-        title = u'Favourite colors',
-        value_type = schema.Choice(
-            vocabulary = colors
+        title=u'Favourite colors',
+        value_type=schema.Choice(
+            vocabulary=colors
             ),
-        required = True,
-        default = [],
+        required=True,
+        #defaultFactory=list
+        default=[],
         )
     friends = schema.List(
-        title = u'Friends',
-        value_type = schema.TextLine(
-            title = u'Name',
+        title=u'Friends',
+        value_type=schema.TextLine(
+            title=u'Name',
             )
         )
@@ -117,4 +120,5 @@
         if contact.age > 16 and contact.name == 'Kevin':
             raise Invalid('Kevins are age 16 or below.')
+
 
 class Contact(object):
@@ -127,4 +131,5 @@
 form_fields_omit = form.Fields(IContact).omit('name', 'vip')
 
+
 class ContactFactory(object):
     """A factory for faculty containers.
@@ -137,4 +142,5 @@
     def getInterfaces(self):
         return implementedBy(Faculty)
+
 
 class FieldConverterTests(unittest.TestCase):
@@ -156,4 +162,5 @@
         return
 
+
 class ConverterTests(FunctionalTestCase):
 
@@ -197,5 +204,5 @@
         contact.age = 33
         input_data = dict(name='Rudi', age='99')
-        converter = IObjectConverter(IContact) # a converter to IContact
+        converter = IObjectConverter(IContact)  # a converter to IContact
         err, inv_err, data = converter.fromStringDict(
             input_data, contact)
@@ -209,5 +216,5 @@
         input_data1 = dict(vip='on')
         input_data2 = dict(vip='')
-        converter = IObjectConverter(IContact) # a converter to IContact
+        converter = IObjectConverter(IContact)  # a converter to IContact
         err1, inv_err1, data1 = converter.fromStringDict(
             input_data1, contact1)
@@ -218,10 +225,10 @@
 
     def test_bool_nonstandard_values1(self):
-        # We accept 'true', 'True', 'tRuE', 'faLSE' and similar.
+         # We accept 'true', 'True', 'tRuE', 'faLSE' and similar.
         contact1 = Contact()
         contact2 = Contact()
         input_data1 = dict(vip='True')
         input_data2 = dict(vip='false')
-        converter = IObjectConverter(IContact) # a converter to IContact
+        converter = IObjectConverter(IContact)  # a converter to IContact
         err1, inv_err1, data1 = converter.fromStringDict(
             input_data1, contact1)
@@ -237,5 +244,5 @@
         input_data1 = dict(vip='1')
         input_data2 = dict(vip='0')
-        converter = IObjectConverter(IContact) # a converter to IContact
+        converter = IObjectConverter(IContact)  # a converter to IContact
         err1, inv_err1, data1 = converter.fromStringDict(
             input_data1, contact1)
@@ -251,5 +258,5 @@
         input_data1 = dict(vip='Yes')
         input_data2 = dict(vip='no')
-        converter = IObjectConverter(IContact) # a converter to IContact
+        converter = IObjectConverter(IContact)  # a converter to IContact
         err1, inv_err1, data1 = converter.fromStringDict(
             input_data1, contact1)
@@ -262,5 +269,5 @@
         contact = Contact()
         input_data = dict(age='99')
-        converter = IObjectConverter(IContact) # a converter to IContact
+        converter = IObjectConverter(IContact)  # a converter to IContact
         err, inv_err, data = converter.fromStringDict(
             input_data, contact)
@@ -271,5 +278,5 @@
         contact = Contact()
         input_data = dict(age='sweet sixteen')
-        converter = IObjectConverter(IContact) # a converter to IContact
+        converter = IObjectConverter(IContact)  # a converter to IContact
         err, inv_err, new_contact = converter.fromStringDict(
             input_data, contact)
@@ -280,5 +287,5 @@
         contact = Contact()
         input_data = dict(name='Rudi')
-        converter = IObjectConverter(IContact) # a converter to IContact
+        converter = IObjectConverter(IContact)  # a converter to IContact
         err, inv_err, data = converter.fromStringDict(
             input_data, contact)
@@ -290,5 +297,5 @@
         contact = Contact()
         input_data = dict(name='Kevin', age='22')
-        converter = IObjectConverter(IContact) # a converter to IContact
+        converter = IObjectConverter(IContact)  # a converter to IContact
         err, inv_err, new_contact = converter.fromStringDict(
             input_data, contact)
@@ -298,5 +305,5 @@
     def test_date(self):
         contact = Contact()
-        converter = IObjectConverter(IContact) # a converter to IContact
+        converter = IObjectConverter(IContact)  # a converter to IContact
 
         # The input format for dates: YYYY-MM-DD
@@ -309,5 +316,5 @@
             dict(birthday='1945-23-12'), contact)
         #assert data['birthday'] == datetime.date(1945, 12, 23)
-        assert err[0][1] =='Invalid datetime data'
+        assert err[0][1] == 'Invalid datetime data'
 
         # '08' is not interpreted as octal number
@@ -319,5 +326,5 @@
     def test_date_invalid(self):
         contact = Contact()
-        converter = IObjectConverter(IContact) # a converter to IContact
+        converter = IObjectConverter(IContact)  # a converter to IContact
         err, inv_err, data = converter.fromStringDict(
             dict(birthday='not-a-date'), contact)
@@ -327,5 +334,5 @@
         # We can use our own formfields and select only a subset of fields
         contact = Contact()
-        converter = IObjectConverter(IContact) # a converter to IContact
+        converter = IObjectConverter(IContact)  # a converter to IContact
         input_data = dict(name='Bruno', age='99', vip='on')
         err, inv_err, data = converter.fromStringDict(
@@ -339,5 +346,5 @@
         # We can use our own formfields and omit some fields
         contact = Contact()
-        converter = IObjectConverter(IContact) # a converter to IContact
+        converter = IObjectConverter(IContact)  # a converter to IContact
         input_data = dict(name='Bruno', age='99', vip='on')
         err, inv_err, data = converter.fromStringDict(
@@ -350,5 +357,5 @@
     def test_factory(self):
         # We can use factories to convert values
-        converter = IObjectConverter(IContact) # a converter to IContact
+        converter = IObjectConverter(IContact)  # a converter to IContact
         # pass string ``contact`` instead of a real object
         err, inv_err, data = converter.fromStringDict(
@@ -360,5 +367,5 @@
     def test_choice_vocab(self):
         # We can handle vocabularies
-        converter = IObjectConverter(IContact) # a converter to IContact
+        converter = IObjectConverter(IContact)  # a converter to IContact
         err, inv_err, data = converter.fromStringDict(
             dict(fav_color='blue'), 'contact')
@@ -369,5 +376,5 @@
     def test_choice_vocab_invalid_value(self):
         # We can handle vocabularies
-        converter = IObjectConverter(IContact) # a converter to IContact
+        converter = IObjectConverter(IContact)  # a converter to IContact
         err, inv_err, data = converter.fromStringDict(
             dict(fav_color='magenta'), 'contact')
@@ -378,5 +385,5 @@
     def test_non_string_choice(self):
         # We can handle vocabs with non-string values
-        converter = IObjectConverter(IContact) # a converter to IContact
+        converter = IObjectConverter(IContact)  # a converter to IContact
         err, inv_err, data = converter.fromStringDict(
             dict(num_cars='1'), 'contact')
@@ -401,5 +408,5 @@
         g_val1, g_val2 = list(g_src.factory.getValues())[0:2]
         req_string = u"[('%s', '%s'), ('%s', '%s')]" % (
-                s_val1, g_val1, s_val2, g_val2)
+            s_val1, g_val1, s_val2, g_val2)
         err, inv_err, data = converter.fromStringDict(
             {"grades": req_string,
