mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Updated test assertions that have been deprecated by the move to unittest2. In summary, this means:
assert_ -> assertTrue assertEquals -> assertEqual failUnless -> assertTrue For full details, see http://www.voidspace.org.uk/python/articles/unittest2.shtml#deprecations git-svn-id: http://code.djangoproject.com/svn/django/trunk@15728 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -155,7 +155,7 @@ class AdminScriptTestCase(unittest.TestCase):
|
||||
|
||||
def assertNoOutput(self, stream):
|
||||
"Utility assertion: assert that the given stream is empty"
|
||||
self.assertEquals(len(stream), 0, "Stream should be empty: actually contains '%s'" % stream)
|
||||
self.assertEqual(len(stream), 0, "Stream should be empty: actually contains '%s'" % stream)
|
||||
def assertOutput(self, stream, msg):
|
||||
"Utility assertion: assert that the given message exists in the output"
|
||||
self.assertTrue(msg in stream, "'%s' does not match actual output text '%s'" % (msg, stream))
|
||||
@@ -545,7 +545,7 @@ class DjangoAdminSettingsDirectory(AdminScriptTestCase):
|
||||
args = ['startapp','settings_test']
|
||||
out, err = self.run_django_admin(args,'settings')
|
||||
self.assertNoOutput(err)
|
||||
self.assert_(os.path.exists(os.path.join(test_dir, 'settings_test')))
|
||||
self.assertTrue(os.path.exists(os.path.join(test_dir, 'settings_test')))
|
||||
shutil.rmtree(os.path.join(test_dir, 'settings_test'))
|
||||
|
||||
def test_builtin_command(self):
|
||||
|
||||
Reference in New Issue
Block a user