summaryrefslogtreecommitdiff
path: root/factory/containers.py
diff options
context:
space:
mode:
authorCarl Meyer <carl@oddbird.net>2012-01-11 14:11:45 -0700
committerCarl Meyer <carl@oddbird.net>2012-01-11 14:11:45 -0700
commit86393d4d1117426bc2aafbfb9f11f96c463f05f1 (patch)
tree6f84f9c1ded5beb90a87301d64b5e1180048ee28 /factory/containers.py
parent1d2ca8d02e190460f85d20be47bbb1e02f268bd2 (diff)
downloadfactory-boy-86393d4d1117426bc2aafbfb9f11f96c463f05f1.tar
factory-boy-86393d4d1117426bc2aafbfb9f11f96c463f05f1.tar.gz
Allow public classmethods on factories.
Diffstat (limited to 'factory/containers.py')
-rw-r--r--factory/containers.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/factory/containers.py b/factory/containers.py
index e280162..9fe8e46 100644
--- a/factory/containers.py
+++ b/factory/containers.py
@@ -107,13 +107,13 @@ class DeclarationDict(dict):
"""Updates the DeclarationDict from a class definition dict.
Takes into account all public attributes and OrderedDeclaration
- instances; ignores all attributes starting with '_'.
+ instances; ignores all classmethods and attributes starting with '_'.
Returns a dict containing all remaining elements.
"""
remaining = {}
for k, v in d.iteritems():
- if k.startswith('_') and not isinstance(v, declarations.OrderedDeclaration):
+ if isinstance(v, classmethod) or k.startswith('_') and not isinstance(v, declarations.OrderedDeclaration):
remaining[k] = v
else:
self[k] = v