diff options
author | Richard Moch <richard@mbp.polyconseil.fr> | 2011-08-17 16:48:33 +0200 |
---|---|---|
committer | Richard Moch <richard@mbp.polyconseil.fr> | 2011-08-17 16:48:33 +0200 |
commit | e7ff751f670df86450a7e09d1c6b542c32448ef4 (patch) | |
tree | 4681619aa5c2807825996dd2ca442f9c25a42b96 /factory | |
parent | bbe78f8b43ee92120072a7be8c3e5b24f9f8a940 (diff) | |
download | factory-boy-e7ff751f670df86450a7e09d1c6b542c32448ef4.tar factory-boy-e7ff751f670df86450a7e09d1c6b542c32448ef4.tar.gz |
Bugfix DjangoModelFactory
Diffstat (limited to 'factory')
-rw-r--r-- | factory/__init__.py | 1 | ||||
-rw-r--r-- | factory/base.py | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/factory/__init__.py b/factory/__init__.py index 9a1513d..4669e61 100644 --- a/factory/__init__.py +++ b/factory/__init__.py @@ -24,6 +24,7 @@ __author__ = 'Mark Sandstrom <mark@deliciouslynerdy.com>' from base import ( Factory, StubFactory, + DjangoModelFactory, BUILD_STRATEGY, CREATE_STRATEGY, STUB_STRATEGY diff --git a/factory/base.py b/factory/base.py index 61bf07e..f33657f 100644 --- a/factory/base.py +++ b/factory/base.py @@ -264,6 +264,6 @@ class DjangoModelFactory(Factory): @classmethod def _setup_next_sequence(cls): try: - return cls._associated_class.objects.values_list('id').order_by('-id')[0] + 1 + return cls._associated_class.objects.values_list('id').order_by('-id')[0][0] + 1 except IndexError: return 1 |