We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 11b952d commit 6a0825fCopy full SHA for 6a0825f
tests/test_base.py
@@ -281,6 +281,22 @@ class Meta:
281
ones = {x.one for x in (parent, alt_parent, sub, alt_sub)}
282
self.assertEqual(4, len(ones))
283
284
+ def test_inheritance_with_function_as_meta_model(self):
285
+ def make_test_object(**kwargs):
286
+ return TestObject(**kwargs)
287
+
288
+ class TestObjectFactory(base.Factory):
289
+ class Meta:
290
+ model = make_test_object
291
292
+ one = "foo"
293
294
+ class TestSubFactory(TestObjectFactory):
295
+ one = "bar"
296
297
+ sub = TestSubFactory.build()
298
+ self.assertEqual(sub.one, "bar")
299
300
301
class FactorySequenceTestCase(unittest.TestCase):
302
def setUp(self):
0 commit comments