summaryrefslogtreecommitdiff
path: root/tests/test_using.py
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2016-04-02 16:13:34 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2016-04-02 17:11:46 +0200
commitc77962de7dd7206ccab85b44da173832acbf5921 (patch)
tree0913b772d5181f654d5ce824753186a2252e9691 /tests/test_using.py
parenteea28cce1544021f3d152782c9932a20402d6240 (diff)
downloadfactory-boy-c77962de7dd7206ccab85b44da173832acbf5921.tar
factory-boy-c77962de7dd7206ccab85b44da173832acbf5921.tar.gz
Add a new Params section to factories.
This handles parameters that alter the declarations of a factory. A few technical notes: - A parameter's outcome may alter other parameters - In order to fix that, we perform a (simple) cyclic definition detection at class declaration time. - Parameters may only be either naked values or ComplexParameter subclasses - Parameters are never passed to the underlying class
Diffstat (limited to 'tests/test_using.py')
-rw-r--r--tests/test_using.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_using.py b/tests/test_using.py
index 3ef5403..67db3bc 100644
--- a/tests/test_using.py
+++ b/tests/test_using.py
@@ -40,6 +40,15 @@ class TestObject(object):
self.four = four
self.five = five
+ def as_dict(self):
+ return dict(
+ one=self.one,
+ two=self.two,
+ three=self.three,
+ four=self.four,
+ five=self.five,
+ )
+
class FakeModel(object):
@classmethod