4teamwork / ftw.builder

Builder pattern for creating Plone objects in tests
3 stars 0 forks source link

DxBuilder: Fix encoding problem when filling default value for "owners" field #27

Closed jone closed 10 years ago

jone commented 10 years ago

Fixes #23

The default value adapter for the IOwnership.owners field returns a tuple of byte strings, but unicodes are required.

Although it is not correct it is not a problem in the "real" world, since the default value adapter is used for filling the form field, which is converted to unicodes correctly when submitted. Therefore I decided to do a hack which fixes this issue for exactly this field. I've not done it in a more generic way because our custom fields should have better default value adapters which use unicodes.

@elioschmutz @deiferni this fixes the issues you've had with

WrongContainedType: ([WrongType('test_user_1_', <type 'unicode'>, '')], 'creators')