1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

[1.2.X] Removed all usages of deprecated TestCase methods (self.fail*). This removed most of the Warnings emitted (with -Wall) during the test suite. Backport of [14803].

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14805 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Alex Gaynor
2010-12-04 07:49:31 +00:00
parent 5a792ec4cc
commit cc48f66f73
27 changed files with 403 additions and 388 deletions

View File

@@ -47,28 +47,28 @@ class EggLoadingTest(TestCase):
egg_name = '%s/modelapp.egg' % self.egg_dir
sys.path.append(egg_name)
models = load_app('app_with_models')
self.failIf(models is None)
self.assertFalse(models is None)
def test_egg2(self):
"""Loading an app from an egg that has no models returns no models (and no error)"""
egg_name = '%s/nomodelapp.egg' % self.egg_dir
sys.path.append(egg_name)
models = load_app('app_no_models')
self.failUnless(models is None)
self.assertTrue(models is None)
def test_egg3(self):
"""Models module can be loaded from an app located under an egg's top-level package"""
egg_name = '%s/omelet.egg' % self.egg_dir
sys.path.append(egg_name)
models = load_app('omelet.app_with_models')
self.failIf(models is None)
self.assertFalse(models is None)
def test_egg4(self):
"""Loading an app with no models from under the top-level egg package generates no error"""
egg_name = '%s/omelet.egg' % self.egg_dir
sys.path.append(egg_name)
models = load_app('omelet.app_no_models')
self.failUnless(models is None)
self.assertTrue(models is None)
def test_egg5(self):
"""Loading an app from an egg that has an import error in its models module raises that error"""
@@ -80,4 +80,4 @@ class EggLoadingTest(TestCase):
except ImportError, e:
# Make sure the message is indicating the actual
# problem in the broken app.
self.failUnless("modelz" in e.args[0])
self.assertTrue("modelz" in e.args[0])