rbarrois/factory_boy — pull request #112 by matthewowen (2013-12-11 01:14:30+00:00)
Title: Stop attempting to save mongoengine EmbeddedDocuments on creation

In mongoengine EmbeddedDocuments are direct children of parent documents, and don't have a save method. As is stands, it isn't possible to create Documents which include EmbeddedDocument SubFactories, because the create propagates to the EmbeddedDocument and errors out.

Not sure on your take on the solution: I initially thought an elegant solution might be to allow a default mode of creation to be specified when defining the subfactory, but that creates problems too – because if the user does specify a non-default build strategy, then that strategy should, as a general rule, override it.