diff options
author | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2012-04-07 02:15:40 +0200 |
---|---|---|
committer | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2012-04-07 02:15:40 +0200 |
commit | ff958948b937386d3c8581dbe0dc368e5796c15a (patch) | |
tree | fff4136101c81de55663bdef8e776d3fe3120bde /factory | |
parent | 4bcf146c71589f4b225823eb418ee6908b2efb6b (diff) | |
download | factory-boy-ff958948b937386d3c8581dbe0dc368e5796c15a.tar factory-boy-ff958948b937386d3c8581dbe0dc368e5796c15a.tar.gz |
Fix the __str__ method of factory classes.
Diffstat (limited to 'factory')
-rw-r--r-- | factory/base.py | 7 |
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. |