diff options
author | Carl Meyer <carl@oddbird.net> | 2012-01-12 09:01:46 -0700 |
---|---|---|
committer | Carl Meyer <carl@oddbird.net> | 2012-01-12 09:01:46 -0700 |
commit | 99ffa8c49df4baa9681d649ce0b19b6d3b5ad99a (patch) | |
tree | f0395eaea6f8b882abc3fda55f9bbf71176968f4 /tests/test_using.py | |
parent | 8aec45386aaf410a36bdf57ebf24cfe9f1fdf3b2 (diff) | |
download | factory-boy-99ffa8c49df4baa9681d649ce0b19b6d3b5ad99a.tar factory-boy-99ffa8c49df4baa9681d649ce0b19b6d3b5ad99a.tar.gz |
Added support for staticmethods on factories as well.
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 4256cc3..d1e4262 100644 --- a/tests/test_using.py +++ b/tests/test_using.py @@ -288,6 +288,14 @@ class FactoryTestCase(unittest.TestCase): self.assertEqual(TestObjectFactory.alt_create(foo=1), {"foo": 1}) + def testStaticMethodAccessible(self): + class TestObjectFactory(factory.Factory): + @staticmethod + def alt_create(**kwargs): + return kwargs + + self.assertEqual(TestObjectFactory.alt_create(foo=1), {"foo": 1}) + class SubFactoryTestCase(unittest.TestCase): def testSubFactory(self): |