summaryrefslogtreecommitdiff
path: root/factory
diff options
context:
space:
mode:
authorIvan Miric <imiric@gmail.com>2013-10-16 22:25:26 +0200
committerRaphaƫl Barrois <raphael.barrois@polyconseil.fr>2013-12-25 01:21:18 +0100
commit924d8a6ac279ca6ad560a3cf5efa1b141cedd253 (patch)
tree9b9eb975badef0e62967599a01b2aa335c66d9f4 /factory
parentb2c15880cc0bfe9a0c149ce3124813e95e8592b0 (diff)
downloadfactory-boy-924d8a6ac279ca6ad560a3cf5efa1b141cedd253.tar
factory-boy-924d8a6ac279ca6ad560a3cf5efa1b141cedd253.tar.gz
Added SubFactory support for MongoEngine's EmbeddedDocument
Diffstat (limited to 'factory')
-rw-r--r--factory/mongoengine.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/factory/mongoengine.py b/factory/mongoengine.py
index 8cd3a67..462f5f2 100644
--- a/factory/mongoengine.py
+++ b/factory/mongoengine.py
@@ -41,5 +41,6 @@ class MongoEngineFactory(base.Factory):
@classmethod
def _create(cls, target_class, *args, **kwargs):
instance = target_class(*args, **kwargs)
- instance.save()
+ if instance._is_document:
+ instance.save()
return instance