From afd040d4d3a06fe92e3080870b2ff2095ce86a75 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 3 Mar 2011 15:04:39 +0000 Subject: 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 --- tests/regressiontests/staticfiles_tests/tests.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/regressiontests/staticfiles_tests') diff --git a/tests/regressiontests/staticfiles_tests/tests.py b/tests/regressiontests/staticfiles_tests/tests.py index 9a2ca6a3ec..4cadd69b6b 100644 --- a/tests/regressiontests/staticfiles_tests/tests.py +++ b/tests/regressiontests/staticfiles_tests/tests.py @@ -194,7 +194,7 @@ class TestFindStatic(BuildStaticTestCase, TestDefaults): lines = [l.strip() for l in sys.stdout.readlines()] finally: sys.stdout = _stdout - self.assertEquals(len(lines), 3) # three because there is also the "Found here" line + self.assertEqual(len(lines), 3) # three because there is also the "Found here" line self.assertTrue('project' in lines[1]) self.assertTrue('apps' in lines[2]) @@ -244,7 +244,7 @@ class TestNoFilesCreated(object): """ Make sure no files were create in the destination directory. """ - self.assertEquals(os.listdir(settings.STATIC_ROOT), []) + self.assertEqual(os.listdir(settings.STATIC_ROOT), []) class TestBuildStaticDryRun(BuildStaticTestCase, TestNoFilesCreated): @@ -302,7 +302,7 @@ class TestServeStatic(StaticFilesTestCase): self.assertContains(self._response(filepath), text) def assertFileNotFound(self, filepath): - self.assertEquals(self._response(filepath).status_code, 404) + self.assertEqual(self._response(filepath).status_code, 404) class TestServeDisabled(TestServeStatic): @@ -349,11 +349,11 @@ class FinderTestCase(object): """ def test_find_first(self): src, dst = self.find_first - self.assertEquals(self.finder.find(src), dst) + self.assertEqual(self.finder.find(src), dst) def test_find_all(self): src, dst = self.find_all - self.assertEquals(self.finder.find(src, all=True), dst) + self.assertEqual(self.finder.find(src, all=True), dst) class TestFileSystemFinder(StaticFilesTestCase, FinderTestCase): -- cgit v1.3