1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

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

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14803 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Alex Gaynor
2010-12-04 07:28:12 +00:00
parent 6770c36262
commit 5bc0ec4ec4
30 changed files with 386 additions and 379 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])