diff options
Diffstat (limited to 'tests/test_using.py')
-rw-r--r-- | tests/test_using.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_using.py b/tests/test_using.py index 9bc466e..8f43813 100644 --- a/tests/test_using.py +++ b/tests/test_using.py @@ -314,6 +314,21 @@ class UsingFactoryTestCase(unittest.TestCase): self.assertEqual(1, obj.id) self.assertTrue(obj.properly_created) + def test_non_django_create(self): + class NonDjango(object): + def __init__(self, x, y=2): + self.x = x + self.y = y + + class NonDjangoFactory(factory.Factory): + FACTORY_FOR = NonDjango + + x = 3 + + obj = NonDjangoFactory.create() + self.assertEqual(3, obj.x) + self.assertEqual(2, obj.y) + def test_sequence_batch(self): class TestObjectFactory(factory.Factory): FACTORY_FOR = TestObject |