4teamwork / ftw.builder

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

DxBuilder: Only determine default values *after* object has been added to container. #28

Closed lukasgraf closed 10 years ago

lukasgraf commented 10 years ago

This solves an issue with IntID generation for objects. I have no idea why this works, but it seems to resolve our current test failures.

/cc @phgross @maethu @jone

jone commented 10 years ago

It works because addContentToContainer triggers events, I guess the IAdded or something like this, which has an event handler setting the int ID. Since you moved it beneath adding the container it works now. This is also better because default value adapters might use the container (e.g. inheriting default values), so it is better to do it like this.