4teamwork / ftw.builder

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

Fixed default value getter for "owners" field not from the plone default... #29

Closed phgross closed 10 years ago

phgross commented 10 years ago

This is a follow up from PR #27.

Because the equality check for fields in zope.schema is insufficient, some special check for the IOwnership.creators fix from the PR #27 is needed.

Because a different tuple field with the name creators (for example in opengever.core is handled as the IOwnership.creators field, because the field.interface is not compared in the equality check. See the following debugging output:

(Pdb) field.interface
<InterfaceClass opengever.base.behaviors.creator.ICreator>
(Pdb) field
<zope.schema._field.Tuple object at 0x106f9b590>
(Pdb) IOwnership['creators']
<zope.schema._field.Tuple object at 0x10698e150>
(Pdb) IOwnership['creators'].interface
<InterfaceClass plone.app.dexterity.behaviors.metadata.IOwnership>
(Pdb) field == IOwnership['creators']
True

@jone, @deiferni

phgross commented 10 years ago

@deiferni added simple comment.

deiferni commented 10 years ago

:+1: