summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2013-03-11 22:17:57 +0100
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2013-03-11 22:22:41 +0100
commitf4100b373418a58dba7ff4f29cfb44df4eca3d15 (patch)
treed0efb5073048bf1f18ab59b5cc7ae4ebcfc51492 /tests
parente8327fcb2e31dd7a9ffc7f53c7a678d1c1135cb2 (diff)
downloadfactory-boy-f4100b373418a58dba7ff4f29cfb44df4eca3d15.tar
factory-boy-f4100b373418a58dba7ff4f29cfb44df4eca3d15.tar.gz
Remove automagic associated class discovery.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_base.py33
1 files changed, 1 insertions, 32 deletions
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