From 853ecc70f0e1772b607554e98a714675c1dc5821 Mon Sep 17 00:00:00 2001 From: Raphaël Barrois Date: Wed, 27 Feb 2013 23:54:42 +0100 Subject: Add test for dual class/factory inheritance. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If it works properly, this would make pylint happy. Signed-off-by: Raphaël Barrois --- tests/test_using.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') 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 -- cgit v1.2.3