summaryrefslogtreecommitdiff
path: root/tests/test_using.py
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2013-02-27 23:54:42 +0100
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2013-02-27 23:54:42 +0100
commit853ecc70f0e1772b607554e98a714675c1dc5821 (patch)
tree722f0c133018432ea774e0297f483011000ba37b /tests/test_using.py
parent5fc48cc597e18e014e7bf6947bee8d371aababb3 (diff)
downloadfactory-boy-853ecc70f0e1772b607554e98a714675c1dc5821.tar
factory-boy-853ecc70f0e1772b607554e98a714675c1dc5821.tar.gz
Add test for dual class/factory inheritance.
If it works properly, this would make pylint happy. Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
Diffstat (limited to 'tests/test_using.py')
-rw-r--r--tests/test_using.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_using.py b/tests/test_using.py
index 5453b95..fb0e8b0 100644
--- a/tests/test_using.py
+++ b/tests/test_using.py
@@ -249,6 +249,16 @@ class UsingFactoryTestCase(unittest.TestCase):
test_object = TestObjectFactory.build()
self.assertEqual(test_object.one, 'one')
+ def test_inheritance(self):
+ @factory.use_strategy(factory.BUILD_STRATEGY)
+ class TestObjectFactory(factory.Factory, TestObject):
+ FACTORY_FOR = TestObject
+
+ one = 'one'
+
+ test_object = TestObjectFactory()
+ self.assertEqual(test_object.one, 'one')
+
def test_abstract(self):
class SomeAbstractFactory(factory.Factory):
FACTORY_ABSTRACT = True