summaryrefslogtreecommitdiff
path: root/factory/base.py
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2012-04-07 02:15:40 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2012-04-07 02:15:40 +0200
commitff958948b937386d3c8581dbe0dc368e5796c15a (patch)
treefff4136101c81de55663bdef8e776d3fe3120bde /factory/base.py
parent4bcf146c71589f4b225823eb418ee6908b2efb6b (diff)
downloadfactory-boy-ff958948b937386d3c8581dbe0dc368e5796c15a.tar
factory-boy-ff958948b937386d3c8581dbe0dc368e5796c15a.tar.gz
Fix the __str__ method of factory classes.
Diffstat (limited to 'factory/base.py')
-rw-r--r--factory/base.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/factory/base.py b/factory/base.py
index 0edf961..4ccda9e 100644
--- a/factory/base.py
+++ b/factory/base.py
@@ -227,6 +227,9 @@ class FactoryMetaClass(BaseFactoryMetaClass):
return super(FactoryMetaClass, cls).__new__(cls, class_name, bases, attrs, extra_attrs=extra_attrs)
+ def __str__(self):
+ return '<%s for %s>' % (self.__name__,
+ getattr(self, CLASS_ATTRIBUTE_ASSOCIATED_CLASS).__name__)
# Factory base classes
@@ -454,10 +457,6 @@ class Factory(BaseFactory):
# from turning it into an instance method.
_creation_function = (DJANGO_CREATION,)
- def __str__(self):
- return '<%s for %s>' % (self.__class__.__name__,
- getattr(self, CLASS_ATTRIBUTE_ASSOCIATED_CLASS).__name__)
-
@classmethod
def set_creation_function(cls, creation_function):
"""Set the creation function for this class.