diff options
author | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2012-11-14 23:53:26 +0100 |
---|---|---|
committer | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2012-11-15 00:03:37 +0100 |
commit | a5184785b1229e02ec75506db675a2377b32c297 (patch) | |
tree | 415a1f83a97d6d128c1e5c75cba8a228608e5699 /tests/test_base.py | |
parent | 048fb1cc935a2ccbc5ca7af81c9390e218a1080b (diff) | |
download | factory-boy-a5184785b1229e02ec75506db675a2377b32c297.tar factory-boy-a5184785b1229e02ec75506db675a2377b32c297.tar.gz |
Keep FACTORY_FOR around.
And add a test too.
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
Diffstat (limited to 'tests/test_base.py')
-rw-r--r-- | tests/test_base.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_base.py b/tests/test_base.py index 63fc62b..64570cd 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -64,6 +64,14 @@ class SafetyTestCase(unittest.TestCase): class FactoryTestCase(unittest.TestCase): + def test_factory_for(self): + class TestObjectFactory(base.Factory): + FACTORY_FOR = TestObject + + self.assertEqual(TestObject, TestObjectFactory.FACTORY_FOR) + obj = TestObjectFactory.build() + self.assertFalse(hasattr(obj, 'FACTORY_FOR')) + def testDisplay(self): class TestObjectFactory(base.Factory): FACTORY_FOR = FakeDjangoModel |