Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed usage of several deprecated aliases in unittest.

  • Loading branch information...
commit 54afdbf37869ef27671b2ba9887043254ce82dd0 1 parent d674bd6
@alex alex authored Alex Gaynor committed
View
2  tests/modeltests/prefetch_related/tests.py
@@ -352,7 +352,7 @@ def test_foreignkey_to_inherited(self):
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')
View
2  tests/regressiontests/admin_views/tests.py
@@ -2361,7 +2361,7 @@ def test_selection_counter(self):
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)
View
4 tests/regressiontests/cache/tests.py
@@ -1513,7 +1513,7 @@ def test_middleware(self):
# 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 @@ def test_middleware(self):
# 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)
View
38 tests/regressiontests/queries/tests.py
@@ -2043,65 +2043,65 @@ def as_sql(self, qn, connection):
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)
Please sign in to comment.
Something went wrong with that request. Please try again.