diff options
Diffstat (limited to 'tests/test_base.py')
-rw-r--r-- | tests/test_base.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_base.py b/tests/test_base.py index e0a6547..7575ee2 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -229,5 +229,23 @@ class FactoryCreationTestCase(unittest.TestCase): self.assertTrue('autodiscovery' not in str(e)) +class PostGenerationParsingTestCase(unittest.TestCase): + + def test_extraction(self): + class TestObjectFactory(base.Factory): + foo = declarations.PostGenerationDeclaration() + + self.assertIn('foo', TestObjectFactory._postgen_declarations) + + def test_classlevel_extraction(self): + class TestObjectFactory(base.Factory): + foo = declarations.PostGenerationDeclaration() + foo__bar = 42 + + self.assertIn('foo', TestObjectFactory._postgen_declarations) + self.assertIn('foo__bar', TestObjectFactory._declarations) + + + if __name__ == '__main__': unittest.main() |