summaryrefslogtreecommitdiff
path: root/factory
diff options
context:
space:
mode:
Diffstat (limited to 'factory')
-rw-r--r--factory/base.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/factory/base.py b/factory/base.py
index e798c68..a6ab98e 100644
--- a/factory/base.py
+++ b/factory/base.py
@@ -705,7 +705,9 @@ def make_factory(klass, **kwargs):
"""Create a new, simple factory for the given class."""
factory_name = '%sFactory' % klass.__name__
kwargs[FACTORY_CLASS_DECLARATION] = klass
- factory_class = type(Factory).__new__(type(Factory), factory_name, (Factory,), kwargs)
+ base_class = kwargs.pop('FACTORY_CLASS', Factory)
+
+ factory_class = type(Factory).__new__(type(Factory), factory_name, (base_class,), kwargs)
factory_class.__name__ = '%sFactory' % klass.__name__
factory_class.__doc__ = 'Auto-generated factory for class %s' % klass
return factory_class