From 54afdbf37869ef27671b2ba9887043254ce82dd0 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Wed, 15 Aug 2012 01:38:04 -0700 Subject: [PATCH] Fixed usage of several deprecated aliases in unittest. --- tests/modeltests/prefetch_related/tests.py | 2 +- tests/regressiontests/admin_views/tests.py | 2 +- tests/regressiontests/cache/tests.py | 4 +-- tests/regressiontests/queries/tests.py | 38 +++++++++++----------- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/modeltests/prefetch_related/tests.py b/tests/modeltests/prefetch_related/tests.py index 8ae0a1e298..614a5fc1d6 100644 --- a/tests/modeltests/prefetch_related/tests.py +++ b/tests/modeltests/prefetch_related/tests.py @@ -352,7 +352,7 @@ class MultiTableInheritanceTest(TestCase): with self.assertNumQueries(2): qs = BookReview.objects.prefetch_related('book') titles = [obj.book.title for obj in qs] - self.assertEquals(titles, ["Poems", "More poems"]) + self.assertEqual(titles, ["Poems", "More poems"]) def test_m2m_to_inheriting_model(self): qs = AuthorWithAge.objects.prefetch_related('books_with_year') diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py index e43ebe471e..679e3a0346 100644 --- a/tests/regressiontests/admin_views/tests.py +++ b/tests/regressiontests/admin_views/tests.py @@ -2361,7 +2361,7 @@ class AdminActionsTest(TestCase): def test_popup_actions(self): """ Actions should not be shown in popups. """ response = self.client.get('/test_admin/admin/admin_views/subscriber/') - self.assertNotEquals(response.context["action_form"], None) + self.assertNotEqual(response.context["action_form"], None) response = self.client.get( '/test_admin/admin/admin_views/subscriber/?%s' % IS_POPUP_VAR) self.assertEqual(response.context["action_form"], None) diff --git a/tests/regressiontests/cache/tests.py b/tests/regressiontests/cache/tests.py index 24cab64c10..33840d65d7 100644 --- a/tests/regressiontests/cache/tests.py +++ b/tests/regressiontests/cache/tests.py @@ -1513,7 +1513,7 @@ class CacheMiddlewareTest(TestCase): # Repeating the request should result in a cache hit result = middleware.process_request(request) - self.assertNotEquals(result, None) + self.assertNotEqual(result, None) self.assertEqual(result.content, 'Hello World 1') # The same request through a different middleware won't hit @@ -1522,7 +1522,7 @@ class CacheMiddlewareTest(TestCase): # The same request with a timeout _will_ hit result = timeout_middleware.process_request(request) - self.assertNotEquals(result, None) + self.assertNotEqual(result, None) self.assertEqual(result.content, 'Hello World 1') @override_settings(CACHE_MIDDLEWARE_ANONYMOUS_ONLY=True) diff --git a/tests/regressiontests/queries/tests.py b/tests/regressiontests/queries/tests.py index 53afd2bd93..85ea4aa452 100644 --- a/tests/regressiontests/queries/tests.py +++ b/tests/regressiontests/queries/tests.py @@ -2043,65 +2043,65 @@ class WhereNodeTest(TestCase): def test_empty_full_handling_conjunction(self): qn = connection.ops.quote_name w = WhereNode(children=[EverythingNode()]) - self.assertEquals(w.as_sql(qn, connection), ('', [])) + self.assertEqual(w.as_sql(qn, connection), ('', [])) w.negate() self.assertRaises(EmptyResultSet, w.as_sql, qn, connection) w = WhereNode(children=[NothingNode()]) self.assertRaises(EmptyResultSet, w.as_sql, qn, connection) w.negate() - self.assertEquals(w.as_sql(qn, connection), ('', [])) + self.assertEqual(w.as_sql(qn, connection), ('', [])) w = WhereNode(children=[EverythingNode(), EverythingNode()]) - self.assertEquals(w.as_sql(qn, connection), ('', [])) + self.assertEqual(w.as_sql(qn, connection), ('', [])) w.negate() self.assertRaises(EmptyResultSet, w.as_sql, qn, connection) w = WhereNode(children=[EverythingNode(), self.DummyNode()]) - self.assertEquals(w.as_sql(qn, connection), ('dummy', [])) + self.assertEqual(w.as_sql(qn, connection), ('dummy', [])) w = WhereNode(children=[self.DummyNode(), self.DummyNode()]) - self.assertEquals(w.as_sql(qn, connection), ('(dummy AND dummy)', [])) + self.assertEqual(w.as_sql(qn, connection), ('(dummy AND dummy)', [])) w.negate() - self.assertEquals(w.as_sql(qn, connection), ('NOT (dummy AND dummy)', [])) + self.assertEqual(w.as_sql(qn, connection), ('NOT (dummy AND dummy)', [])) w = WhereNode(children=[NothingNode(), self.DummyNode()]) self.assertRaises(EmptyResultSet, w.as_sql, qn, connection) w.negate() - self.assertEquals(w.as_sql(qn, connection), ('', [])) + self.assertEqual(w.as_sql(qn, connection), ('', [])) def test_empty_full_handling_disjunction(self): qn = connection.ops.quote_name w = WhereNode(children=[EverythingNode()], connector='OR') - self.assertEquals(w.as_sql(qn, connection), ('', [])) + self.assertEqual(w.as_sql(qn, connection), ('', [])) w.negate() self.assertRaises(EmptyResultSet, w.as_sql, qn, connection) w = WhereNode(children=[NothingNode()], connector='OR') self.assertRaises(EmptyResultSet, w.as_sql, qn, connection) w.negate() - self.assertEquals(w.as_sql(qn, connection), ('', [])) + self.assertEqual(w.as_sql(qn, connection), ('', [])) w = WhereNode(children=[EverythingNode(), EverythingNode()], connector='OR') - self.assertEquals(w.as_sql(qn, connection), ('', [])) + self.assertEqual(w.as_sql(qn, connection), ('', [])) w.negate() self.assertRaises(EmptyResultSet, w.as_sql, qn, connection) w = WhereNode(children=[EverythingNode(), self.DummyNode()], connector='OR') - self.assertEquals(w.as_sql(qn, connection), ('', [])) + self.assertEqual(w.as_sql(qn, connection), ('', [])) w.negate() self.assertRaises(EmptyResultSet, w.as_sql, qn, connection) w = WhereNode(children=[self.DummyNode(), self.DummyNode()], connector='OR') - self.assertEquals(w.as_sql(qn, connection), ('(dummy OR dummy)', [])) + self.assertEqual(w.as_sql(qn, connection), ('(dummy OR dummy)', [])) w.negate() - self.assertEquals(w.as_sql(qn, connection), ('NOT (dummy OR dummy)', [])) + self.assertEqual(w.as_sql(qn, connection), ('NOT (dummy OR dummy)', [])) w = WhereNode(children=[NothingNode(), self.DummyNode()], connector='OR') - self.assertEquals(w.as_sql(qn, connection), ('dummy', [])) + self.assertEqual(w.as_sql(qn, connection), ('dummy', [])) w.negate() - self.assertEquals(w.as_sql(qn, connection), ('NOT (dummy)', [])) + self.assertEqual(w.as_sql(qn, connection), ('NOT (dummy)', [])) def test_empty_nodes(self): qn = connection.ops.quote_name empty_w = WhereNode() w = WhereNode(children=[empty_w, empty_w]) - self.assertEquals(w.as_sql(qn, connection), (None, [])) + self.assertEqual(w.as_sql(qn, connection), (None, [])) w.negate() - self.assertEquals(w.as_sql(qn, connection), (None, [])) + self.assertEqual(w.as_sql(qn, connection), (None, [])) w.connector = 'OR' - self.assertEquals(w.as_sql(qn, connection), (None, [])) + self.assertEqual(w.as_sql(qn, connection), (None, [])) w.negate() - self.assertEquals(w.as_sql(qn, connection), (None, [])) + self.assertEqual(w.as_sql(qn, connection), (None, [])) w = WhereNode(children=[empty_w, NothingNode()], connector='OR') self.assertRaises(EmptyResultSet, w.as_sql, qn, connection)