Ignore:
Timestamp:
10 Jul 2015, 11:33:03 (10 years ago)
Author:
Henrik Bettermann
Message:

Enable import of list-of-choices fields.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_converters.py

    r8216 r13159  
    9898        default = [],
    9999        )
     100    fav_colors = schema.List(
     101        title = u'Favourite colors',
     102        value_type = schema.Choice(
     103            vocabulary = colors
     104            ),
     105        required = True,
     106        default = [],
     107        )
    100108    friends = schema.List(
    101109        title = u'Friends',
     
    405413        return
    406414
     415    def test_list_of_choices(self):
     416        # We cannot handle lists of choices because we are using
     417        # a widget which is not yet supported.
     418        converter = IObjectConverter(IContact)
     419        err, inv_err, data = converter.fromStringDict(
     420            {"fav_colors": "['red', 'green']"}, 'contact')
     421        self.assertEqual(
     422            data, {})
     423        return
     424
    407425    def test_ignore_values(self):
    408426        # in update mode we ignore marked values
Note: See TracChangeset for help on using the changeset viewer.