diff options
author | Carl Meyer <carl@oddbird.net> | 2012-01-12 08:50:27 -0700 |
---|---|---|
committer | Carl Meyer <carl@oddbird.net> | 2012-01-12 08:50:27 -0700 |
commit | bf57308c9dcc2d96161993026e138ec181550653 (patch) | |
tree | 5df89dea6eec605632f5f28a21e4313ed88c6cd9 /tests/test_using.py | |
parent | 24b6a6b83cfb7cd5bab304bb8cc22383cf461d85 (diff) | |
download | factory-boy-bf57308c9dcc2d96161993026e138ec181550653.tar factory-boy-bf57308c9dcc2d96161993026e138ec181550653.tar.gz |
Added API test for classmethod on factory.
Diffstat (limited to 'tests/test_using.py')
-rw-r--r-- | tests/test_using.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_using.py b/tests/test_using.py index e0e59cd..4256cc3 100644 --- a/tests/test_using.py +++ b/tests/test_using.py @@ -280,6 +280,14 @@ class FactoryTestCase(unittest.TestCase): test_object = TestModelFactory.create() self.assertEqual(test_object, "This doesn't even return an instance of TestModel") + def testClassMethodAccessible(self): + class TestObjectFactory(factory.Factory): + @classmethod + def alt_create(cls, **kwargs): + return kwargs + + self.assertEqual(TestObjectFactory.alt_create(foo=1), {"foo": 1}) + class SubFactoryTestCase(unittest.TestCase): def testSubFactory(self): |