From f4100b373418a58dba7ff4f29cfb44df4eca3d15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Barrois?= Date: Mon, 11 Mar 2013 22:17:57 +0100 Subject: Remove automagic associated class discovery. --- tests/test_base.py | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) (limited to 'tests') diff --git a/tests/test_base.py b/tests/test_base.py index 6f16e8f..e86eae3 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -189,29 +189,6 @@ class FactoryCreationTestCase(unittest.TestCase): self.assertTrue(isinstance(TestFactory.build(), TestObject)) - def testAutomaticAssociatedClassDiscovery(self): - with warnings.catch_warnings(): - warnings.simplefilter('ignore') - class TestObjectFactory(base.Factory): - pass - - self.assertTrue(isinstance(TestObjectFactory.build(), TestObject)) - - def testDeprecationWarning(self): - """Make sure the 'auto-discovery' deprecation warning is issued.""" - - with warnings.catch_warnings(record=True) as w: - # Clear the warning registry. - __warningregistry__.clear() - - warnings.simplefilter('always') - class TestObjectFactory(base.Factory): - pass - - self.assertEqual(1, len(w)) - self.assertIn('discovery', str(w[0].message)) - self.assertIn('deprecated', str(w[0].message)) - def testStub(self): class TestFactory(base.StubFactory): pass @@ -250,15 +227,7 @@ class FactoryCreationTestCase(unittest.TestCase): # Errors - def testNoAssociatedClassWithAutodiscovery(self): - try: - class TestFactory(base.Factory): - pass - self.fail() - except base.Factory.AssociatedClassError as e: - self.assertTrue('autodiscovery' in str(e)) - - def testNoAssociatedClassWithoutAutodiscovery(self): + def test_no_associated_class(self): try: class Test(base.Factory): pass -- cgit v1.2.3