summaryrefslogtreecommitdiff
path: root/factory
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2014-05-18 12:34:19 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2014-05-18 14:18:49 +0200
commit395744736691b3412dbedaffa8735e248a70c3c1 (patch)
tree4e4e67f8a907edcad3984a843707cf9b5dcad375 /factory
parent47b34e933f94e71e7aabd81cd1e065a807a55276 (diff)
downloadfactory-boy-395744736691b3412dbedaffa8735e248a70c3c1.tar
factory-boy-395744736691b3412dbedaffa8735e248a70c3c1.tar.gz
Switch tests to class Meta.
Diffstat (limited to 'factory')
-rw-r--r--factory/base.py4
-rw-r--r--factory/mogo.py3
-rw-r--r--factory/mongoengine.py4
3 files changed, 7 insertions, 4 deletions
diff --git a/factory/base.py b/factory/base.py
index d255dbf..7db0c76 100644
--- a/factory/base.py
+++ b/factory/base.py
@@ -40,7 +40,7 @@ class FactoryError(Exception):
class AssociatedClassError(FactoryError):
- """Exception for Factory subclasses lacking FACTORY_FOR."""
+ """Exception for Factory subclasses lacking Meta.target."""
class UnknownStrategy(FactoryError):
@@ -82,7 +82,7 @@ class FactoryMetaClass(type):
elif cls._meta.strategy == STUB_STRATEGY:
return cls.stub(**kwargs)
else:
- raise UnknownStrategy('Unknown FACTORY_STRATEGY: {0}'.format(
+ raise UnknownStrategy('Unknown Meta.strategy: {0}'.format(
cls._meta.strategy))
def __new__(mcs, class_name, bases, attrs):
diff --git a/factory/mogo.py b/factory/mogo.py
index 48d9677..0214119 100644
--- a/factory/mogo.py
+++ b/factory/mogo.py
@@ -32,7 +32,8 @@ from . import base
class MogoFactory(base.Factory):
"""Factory for mogo objects."""
- ABSTRACT_FACTORY = True
+ class Meta:
+ abstract = True
@classmethod
def _build(cls, target_class, *args, **kwargs):
diff --git a/factory/mongoengine.py b/factory/mongoengine.py
index 462f5f2..729ebb1 100644
--- a/factory/mongoengine.py
+++ b/factory/mongoengine.py
@@ -32,7 +32,9 @@ from . import base
class MongoEngineFactory(base.Factory):
"""Factory for mongoengine objects."""
- ABSTRACT_FACTORY = True
+
+ class Meta:
+ abstract = True
@classmethod
def _build(cls, target_class, *args, **kwargs):