Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Replaced deprecated TestCase methods. Refs #17049.

  • Loading branch information...
commit b52672d77822e88752cb178c8a359adde83ff0ba 1 parent e84f79f
Claude Paroz authored May 03, 2012
2  django/contrib/auth/tests/management.py
@@ -50,7 +50,7 @@ def test_that_changepassword_command_changes_joes_password(self):
50 50
         command.execute("joe", stdout=self.stdout)
51 51
         command_output = self.stdout.getvalue().strip()
52 52
 
53  
-        self.assertEquals(command_output, "Changing password for user 'joe'\nPassword changed successfully for user 'joe'")
  53
+        self.assertEqual(command_output, "Changing password for user 'joe'\nPassword changed successfully for user 'joe'")
54 54
         self.assertTrue(models.User.objects.get(username="joe").check_password("not qwerty"))
55 55
 
56 56
     def test_that_max_tries_exits_1(self):
22  django/contrib/auth/tests/models.py
@@ -46,12 +46,12 @@ class NaturalKeysTestCase(TestCase):
46 46
 
47 47
     def test_user_natural_key(self):
48 48
         staff_user = User.objects.get(username='staff')
49  
-        self.assertEquals(User.objects.get_by_natural_key('staff'), staff_user)
50  
-        self.assertEquals(staff_user.natural_key(), ('staff',))
  49
+        self.assertEqual(User.objects.get_by_natural_key('staff'), staff_user)
  50
+        self.assertEqual(staff_user.natural_key(), ('staff',))
51 51
 
52 52
     def test_group_natural_key(self):
53 53
         users_group = Group.objects.create(name='users')
54  
-        self.assertEquals(Group.objects.get_by_natural_key('users'), users_group)
  54
+        self.assertEqual(Group.objects.get_by_natural_key('users'), users_group)
55 55
 
56 56
 
57 57
 @override_settings(USE_TZ=False)
@@ -61,7 +61,7 @@ class LoadDataWithoutNaturalKeysTestCase(TestCase):
61 61
     def test_user_is_created_and_added_to_group(self):
62 62
         user = User.objects.get(username='my_username')
63 63
         group = Group.objects.get(name='my_group')
64  
-        self.assertEquals(group, user.groups.get())
  64
+        self.assertEqual(group, user.groups.get())
65 65
 
66 66
 
67 67
 @override_settings(USE_TZ=False)
@@ -71,7 +71,7 @@ class LoadDataWithNaturalKeysTestCase(TestCase):
71 71
     def test_user_is_created_and_added_to_group(self):
72 72
         user = User.objects.get(username='my_username')
73 73
         group = Group.objects.get(name='my_group')
74  
-        self.assertEquals(group, user.groups.get())
  74
+        self.assertEqual(group, user.groups.get())
75 75
 
76 76
 
77 77
 class UserManagerTestCase(TestCase):
@@ -79,23 +79,23 @@ class UserManagerTestCase(TestCase):
79 79
     def test_create_user(self):
80 80
         email_lowercase = 'normal@normal.com'
81 81
         user = User.objects.create_user('user', email_lowercase)
82  
-        self.assertEquals(user.email, email_lowercase)
83  
-        self.assertEquals(user.username, 'user')
84  
-        self.assertEquals(user.password, '!')
  82
+        self.assertEqual(user.email, email_lowercase)
  83
+        self.assertEqual(user.username, 'user')
  84
+        self.assertEqual(user.password, '!')
85 85
 
86 86
     def test_create_user_email_domain_normalize_rfc3696(self):
87 87
         # According to  http://tools.ietf.org/html/rfc3696#section-3
88 88
         # the "@" symbol can be part of the local part of an email address
89 89
         returned = UserManager.normalize_email(r'Abc\@DEF@EXAMPLE.com')
90  
-        self.assertEquals(returned, r'Abc\@DEF@example.com')
  90
+        self.assertEqual(returned, r'Abc\@DEF@example.com')
91 91
 
92 92
     def test_create_user_email_domain_normalize(self):
93 93
         returned = UserManager.normalize_email('normal@DOMAIN.COM')
94  
-        self.assertEquals(returned, 'normal@domain.com')
  94
+        self.assertEqual(returned, 'normal@domain.com')
95 95
 
96 96
     def test_create_user_email_domain_normalize_with_whitespace(self):
97 97
         returned = UserManager.normalize_email('email\ with_whitespace@D.COM')
98  
-        self.assertEquals(returned, 'email\ with_whitespace@d.com')
  98
+        self.assertEqual(returned, 'email\ with_whitespace@d.com')
99 99
 
100 100
     def test_empty_username(self):
101 101
         self.assertRaisesMessage(ValueError,
6  django/contrib/formtools/tests/wizard/wizardtests/tests.py
@@ -303,7 +303,7 @@ def get_context_data(self, **kwargs):
303 303
         view = TestWizard.as_view([forms.Form])
304 304
 
305 305
         response = view(factory.get('/'))
306  
-        self.assertEquals(response.context_data['test_key'], 'test_value')
  306
+        self.assertEqual(response.context_data['test_key'], 'test_value')
307 307
 
308 308
     def test_get_context_data_with_mixin(self):
309 309
         class AnotherMixin(object):
@@ -329,8 +329,8 @@ def get_context_data(self, **kwargs):
329 329
         view = TestWizard.as_view([forms.Form])
330 330
 
331 331
         response = view(factory.get('/'))
332  
-        self.assertEquals(response.context_data['test_key'], 'test_value')
333  
-        self.assertEquals(response.context_data['another_key'], 'another_value')
  332
+        self.assertEqual(response.context_data['test_key'], 'test_value')
  333
+        self.assertEqual(response.context_data['another_key'], 'another_value')
334 334
 
335 335
 
336 336
 class WizardFormKwargsOverrideTests(TestCase):
2  django/contrib/gis/geoip/tests.py
@@ -87,7 +87,7 @@ def test04_city(self):
87 87
             self.assertEqual('TX', d['region'])
88 88
             self.assertEqual(713, d['area_code'])
89 89
             geom = g.geos(query)
90  
-            self.failIf(not isinstance(geom, GEOSGeometry))
  90
+            self.assertTrue(isinstance(geom, GEOSGeometry))
91 91
             lon, lat = (-95.4010, 29.7079)
92 92
             lat_lon = g.lat_lon(query)
93 93
             lat_lon = (lat_lon[1], lat_lon[0])
8  django/contrib/gis/tests/test_measure.py
@@ -45,7 +45,7 @@ def testAccess(self):
45 45
     def testAccessInvalid(self):
46 46
         "Testing access in invalid units"
47 47
         d = D(m=100)
48  
-        self.failIf(hasattr(d, 'banana'))
  48
+        self.assertFalse(hasattr(d, 'banana'))
49 49
 
50 50
     def testAddition(self):
51 51
         "Test addition & subtraction"
@@ -133,7 +133,7 @@ def testComparisons(self):
133 133
         self.assertTrue(d2 > d1)
134 134
         self.assertTrue(d1 == d1)
135 135
         self.assertTrue(d1 < d2)
136  
-        self.failIf(d3)
  136
+        self.assertFalse(d3)
137 137
 
138 138
     def testUnitsStr(self):
139 139
         "Testing conversion to strings"
@@ -179,7 +179,7 @@ def testAccess(self):
179 179
     def testAccessInvaliA(self):
180 180
         "Testing access in invalid units"
181 181
         a = A(sq_m=100)
182  
-        self.failIf(hasattr(a, 'banana'))
  182
+        self.assertFalse(hasattr(a, 'banana'))
183 183
 
184 184
     def testAddition(self):
185 185
         "Test addition & subtraction"
@@ -267,7 +267,7 @@ def testComparisons(self):
267 267
         self.assertTrue(a2 > a1)
268 268
         self.assertTrue(a1 == a1)
269 269
         self.assertTrue(a1 < a2)
270  
-        self.failIf(a3)
  270
+        self.assertFalse(a3)
271 271
 
272 272
     def testUnitsStr(self):
273 273
         "Testing conversion to strings"
12  tests/modeltests/prefetch_related/tests.py
@@ -341,7 +341,7 @@ def test_foreignkey(self):
@@ -351,7 +351,7 @@ def test_m2m_to_inheriting_model(self):
@@ -360,7 +360,7 @@ def test_m2m_to_inheriting_model(self):
@@ -402,7 +402,7 @@ def test_foreignkey(self):
@@ -411,7 +411,7 @@ def test_m2m(self):
@@ -549,7 +549,7 @@ def test_using_is_honored_m2m(self):
4  tests/modeltests/select_for_update/tests.py
@@ -80,7 +80,7 @@ def has_for_update_sql(self, tested_connection, nowait=False):
80 80
         return bool(sql.find(for_update_sql) > -1)
81 81
 
82 82
     def check_exc(self, exc):
83  
-        self.failUnless(isinstance(exc, DatabaseError))
  83
+        self.assertTrue(isinstance(exc, DatabaseError))
84 84
 
85 85
     @skipUnlessDBFeature('has_select_for_update')
86 86
     def test_for_update_sql_generated(self):
@@ -217,7 +217,7 @@ def test_block(self):
217 217
 
218 218
         # Check the thread has finished. Assuming it has, we should
219 219
         # find that it has updated the person's name.
220  
-        self.failIf(thread.isAlive())
  220
+        self.assertFalse(thread.isAlive())
221 221
 
222 222
         # We must commit the transaction to ensure that MySQL gets a fresh read,
223 223
         # since by default it runs in REPEATABLE READ mode
4  tests/modeltests/test_client/models.py
@@ -378,7 +378,7 @@ def test_view_with_permissions_exception(self):
378 378
 
379 379
         # Get the page without logging in. Should result in 403.
380 380
         response = self.client.get('/test_client/permission_protected_view_exception/')
381  
-        self.assertEquals(response.status_code, 403)
  381
+        self.assertEqual(response.status_code, 403)
382 382
 
383 383
         # Log in
384 384
         login = self.client.login(username='testclient', password='password')
@@ -386,7 +386,7 @@ def test_view_with_permissions_exception(self):
386 386
 
387 387
         # Log in with wrong permissions. Should result in 403.
388 388
         response = self.client.get('/test_client/permission_protected_view_exception/')
389  
-        self.assertEquals(response.status_code, 403)
  389
+        self.assertEqual(response.status_code, 403)
390 390
 
391 391
     def test_view_with_method_permissions(self):
392 392
         "Request a page that is protected with a @permission_required method"
10  tests/regressiontests/admin_filters/tests.py
@@ -270,7 +270,7 @@ def test_relatedfieldlistfilter_foreignkey(self):
270 270
 
271 271
         # Make sure the last choice is None and is selected
272 272
         filterspec = changelist.get_filters(request)[0][1]
273  
-        self.assertEquals(force_unicode(filterspec.title), u'Verbose Author')
  273
+        self.assertEqual(force_unicode(filterspec.title), u'Verbose Author')
274 274
         choices = list(filterspec.choices(changelist))
275 275
         self.assertEqual(choices[-1]['selected'], True)
276 276
         self.assertEqual(choices[-1]['query_string'], '?author__isnull=True')
@@ -280,7 +280,7 @@ def test_relatedfieldlistfilter_foreignkey(self):
280 280
 
281 281
         # Make sure the correct choice is selected
282 282
         filterspec = changelist.get_filters(request)[0][1]
283  
-        self.assertEquals(force_unicode(filterspec.title), u'Verbose Author')
  283
+        self.assertEqual(force_unicode(filterspec.title), u'Verbose Author')
284 284
         # order of choices depends on User model, which has no order
285 285
         choice = select_by(filterspec.choices(changelist), "display", "alfred")
286 286
         self.assertEqual(choice['selected'], True)
@@ -298,7 +298,7 @@ def test_relatedfieldlistfilter_manytomany(self):
298 298
 
299 299
         # Make sure the last choice is None and is selected
300 300
         filterspec = changelist.get_filters(request)[0][2]
301  
-        self.assertEquals(force_unicode(filterspec.title), u'Verbose Contributors')
  301
+        self.assertEqual(force_unicode(filterspec.title), u'Verbose Contributors')
302 302
         choices = list(filterspec.choices(changelist))
303 303
         self.assertEqual(choices[-1]['selected'], True)
304 304
         self.assertEqual(choices[-1]['query_string'], '?contributors__isnull=True')
@@ -308,7 +308,7 @@ def test_relatedfieldlistfilter_manytomany(self):
308 308
 
309 309
         # Make sure the correct choice is selected
310 310
         filterspec = changelist.get_filters(request)[0][2]
311  
-        self.assertEquals(force_unicode(filterspec.title), u'Verbose Contributors')
  311
+        self.assertEqual(force_unicode(filterspec.title), u'Verbose Contributors')
312 312
         choice = select_by(filterspec.choices(changelist), "display", "bob")
313 313
         self.assertEqual(choice['selected'], True)
314 314
         self.assertEqual(choice['query_string'], '?contributors__id__exact=%d' % self.bob.pk)
@@ -509,7 +509,7 @@ def test_simplelistfilter(self):
509 509
         self.assertEqual(choices[3]['query_string'], '?publication-decade=the+00s&author__id__exact=%s' % self.alfred.pk)
510 510
 
511 511
         filterspec = changelist.get_filters(request)[0][0]
512  
-        self.assertEquals(force_unicode(filterspec.title), u'Verbose Author')
  512
+        self.assertEqual(force_unicode(filterspec.title), u'Verbose Author')
513 513
         choice = select_by(filterspec.choices(changelist), "display", "alfred")
514 514
         self.assertEqual(choice['selected'], True)
515 515
         self.assertEqual(choice['query_string'], '?publication-decade=the+00s&author__id__exact=%s' % self.alfred.pk)
44  tests/regressiontests/admin_inlines/tests.py
@@ -405,14 +405,14 @@ def test_add_inlines(self):
405 405
 
406 406
         # Check that there's only one inline to start with and that it has the
407 407
         # correct ID.
408  
-        self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
  408
+        self.assertEqual(len(self.selenium.find_elements_by_css_selector(
409 409
             '.dynamic-profile_set')), 1)
410  
-        self.failUnlessEqual(self.selenium.find_elements_by_css_selector(
  410
+        self.assertEqual(self.selenium.find_elements_by_css_selector(
411 411
             '.dynamic-profile_set')[0].get_attribute('id'),
412 412
             'profile_set-0')
413  
-        self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
  413
+        self.assertEqual(len(self.selenium.find_elements_by_css_selector(
414 414
             '.dynamic-profile_set#profile_set-0 input[name=profile_set-0-first_name]')), 1)
415  
-        self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
  415
+        self.assertEqual(len(self.selenium.find_elements_by_css_selector(
416 416
             '.dynamic-profile_set#profile_set-0 input[name=profile_set-0-last_name]')), 1)
417 417
 
418 418
         # Add an inline
@@ -420,24 +420,24 @@ def test_add_inlines(self):
420 420
 
421 421
         # Check that the inline has been added, that it has the right id, and
422 422
         # that it contains the right fields.
423  
-        self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
  423
+        self.assertEqual(len(self.selenium.find_elements_by_css_selector(
424 424
             '.dynamic-profile_set')), 2)
425  
-        self.failUnlessEqual(self.selenium.find_elements_by_css_selector(
  425
+        self.assertEqual(self.selenium.find_elements_by_css_selector(
426 426
             '.dynamic-profile_set')[1].get_attribute('id'), 'profile_set-1')
427  
-        self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
  427
+        self.assertEqual(len(self.selenium.find_elements_by_css_selector(
428 428
             '.dynamic-profile_set#profile_set-1 input[name=profile_set-1-first_name]')), 1)
429  
-        self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
  429
+        self.assertEqual(len(self.selenium.find_elements_by_css_selector(
430 430
             '.dynamic-profile_set#profile_set-1 input[name=profile_set-1-last_name]')), 1)
431 431
 
432 432
         # Let's add another one to be sure
433 433
         self.selenium.find_element_by_link_text('Add another Profile').click()
434  
-        self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
  434
+        self.assertEqual(len(self.selenium.find_elements_by_css_selector(
435 435
             '.dynamic-profile_set')), 3)
436  
-        self.failUnlessEqual(self.selenium.find_elements_by_css_selector(
  436
+        self.assertEqual(self.selenium.find_elements_by_css_selector(
437 437
             '.dynamic-profile_set')[2].get_attribute('id'), 'profile_set-2')
438  
-        self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
  438
+        self.assertEqual(len(self.selenium.find_elements_by_css_selector(
439 439
             '.dynamic-profile_set#profile_set-2 input[name=profile_set-2-first_name]')), 1)
440  
-        self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
  440
+        self.assertEqual(len(self.selenium.find_elements_by_css_selector(
441 441
             '.dynamic-profile_set#profile_set-2 input[name=profile_set-2-last_name]')), 1)
442 442
 
443 443
         # Enter some data and click 'Save'
@@ -473,17 +473,17 @@ def test_delete_inlines(self):
473 473
         self.selenium.find_element_by_link_text('Add another Profile').click()
474 474
         self.selenium.find_element_by_link_text('Add another Profile').click()
475 475
         self.selenium.find_element_by_link_text('Add another Profile').click()
476  
-        self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
  476
+        self.assertEqual(len(self.selenium.find_elements_by_css_selector(
477 477
             '#profile_set-group table tr.dynamic-profile_set')), 5)
478  
-        self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
  478
+        self.assertEqual(len(self.selenium.find_elements_by_css_selector(
479 479
             'form#profilecollection_form tr.dynamic-profile_set#profile_set-0')), 1)
480  
-        self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
  480
+        self.assertEqual(len(self.selenium.find_elements_by_css_selector(
481 481
             'form#profilecollection_form tr.dynamic-profile_set#profile_set-1')), 1)
482  
-        self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
  482
+        self.assertEqual(len(self.selenium.find_elements_by_css_selector(
483 483
             'form#profilecollection_form tr.dynamic-profile_set#profile_set-2')), 1)
484  
-        self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
  484
+        self.assertEqual(len(self.selenium.find_elements_by_css_selector(
485 485
             'form#profilecollection_form tr.dynamic-profile_set#profile_set-3')), 1)
486  
-        self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
  486
+        self.assertEqual(len(self.selenium.find_elements_by_css_selector(
487 487
             'form#profilecollection_form tr.dynamic-profile_set#profile_set-4')), 1)
488 488
 
489 489
         # Click on a few delete buttons
@@ -492,13 +492,13 @@ def test_delete_inlines(self):
492 492
         self.selenium.find_element_by_css_selector(
493 493
             'form#profilecollection_form tr.dynamic-profile_set#profile_set-2 td.delete a').click()
494 494
         # Verify that they're gone and that the IDs have been re-sequenced
495  
-        self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
  495
+        self.assertEqual(len(self.selenium.find_elements_by_css_selector(
496 496
             '#profile_set-group table tr.dynamic-profile_set')), 3)
497  
-        self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
  497
+        self.assertEqual(len(self.selenium.find_elements_by_css_selector(
498 498
             'form#profilecollection_form tr.dynamic-profile_set#profile_set-0')), 1)
499  
-        self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
  499
+        self.assertEqual(len(self.selenium.find_elements_by_css_selector(
500 500
             'form#profilecollection_form tr.dynamic-profile_set#profile_set-1')), 1)
501  
-        self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
  501
+        self.assertEqual(len(self.selenium.find_elements_by_css_selector(
502 502
             'form#profilecollection_form tr.dynamic-profile_set#profile_set-2')), 1)
503 503
 
504 504
 
2  tests/regressiontests/admin_views/tests.py
@@ -3144,7 +3144,7 @@ def test_readonly_manytomany(self):
3144 3144
     def test_user_password_change_limited_queryset(self):
3145 3145
         su = User.objects.filter(is_superuser=True)[0]
3146 3146
         response = self.client.get('/test_admin/admin2/auth/user/%s/password/' % su.pk)
3147  
-        self.assertEquals(response.status_code, 404)
  3147
+        self.assertEqual(response.status_code, 404)
3148 3148
 
3149 3149
 
3150 3150
 @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
4  tests/regressiontests/backends/tests.py
@@ -521,7 +521,7 @@ def runner():
521 521
             t = threading.Thread(target=runner)
522 522
             t.start()
523 523
             t.join()
524  
-        self.assertEquals(len(connections_set), 3)
  524
+        self.assertEqual(len(connections_set), 3)
525 525
         # Finish by closing the connections opened by the other threads (the
526 526
         # connection opened in the main thread will automatically be closed on
527 527
         # teardown).
@@ -548,7 +548,7 @@ def runner():
548 548
             t = threading.Thread(target=runner)
549 549
             t.start()
550 550
             t.join()
551  
-        self.assertEquals(len(connections_set), 6)
  551
+        self.assertEqual(len(connections_set), 6)
552 552
         # Finish by closing the connections opened by the other threads (the
553 553
         # connection opened in the main thread will automatically be closed on
554 554
         # teardown).
2  tests/regressiontests/createsuperuser/tests.py
@@ -28,7 +28,7 @@ def test_that_changepassword_command_with_database_option_uses_given_db(self):
28 28
         command.execute("joe", database='other', stdout=self.stdout)
29 29
         command_output = self.stdout.getvalue().strip()
30 30
 
31  
-        self.assertEquals(command_output, "Changing password for user 'joe'\nPassword changed successfully for user 'joe'")
  31
+        self.assertEqual(command_output, "Changing password for user 'joe'\nPassword changed successfully for user 'joe'")
32 32
         self.assertTrue(models.User.objects.using('other').get(username="joe").check_password("not qwerty"))
33 33
 
34 34
 
6  tests/regressiontests/file_uploads/tests.py
@@ -202,7 +202,7 @@ def test_truncated_multipart_handled_gracefully(self):
202 202
             'wsgi.input': client.FakePayload(payload),
203 203
         }
204 204
         got = json.loads(self.client.request(**r).content)
205  
-        self.assertEquals(got, {})
  205
+        self.assertEqual(got, {})
206 206
 
207 207
     def test_empty_multipart_handled_gracefully(self):
208 208
         """
@@ -217,7 +217,7 @@ def test_empty_multipart_handled_gracefully(self):
217 217
             'wsgi.input': client.FakePayload(''),
218 218
         }
219 219
         got = json.loads(self.client.request(**r).content)
220  
-        self.assertEquals(got, {})
  220
+        self.assertEqual(got, {})
221 221
 
222 222
     def test_custom_upload_handler(self):
223 223
         # A small file (under the 5M quota)
@@ -313,7 +313,7 @@ def handle_uncaught_exception(self, request, resolver, exc_info):
313 313
         try:
314 314
             response = self.client.post('/file_uploads/upload_errors/', post_data)
315 315
         except reference_error.__class__ as err:
316  
-            self.failIf(
  316
+            self.assertFalse(
317 317
                 str(err) == str(reference_error),
318 318
                 "Caught a repeated exception that'll cause an infinite loop in file uploads."
319 319
             )
10  tests/regressiontests/servers/tests.py
@@ -103,7 +103,7 @@ def test_404(self):
103 103
         try:
104 104
             self.urlopen('/')
105 105
         except urllib2.HTTPError as err:
106  
-            self.assertEquals(err.code, 404, 'Expected 404 response')
  106
+            self.assertEqual(err.code, 404, 'Expected 404 response')
107 107
         else:
108 108
             self.fail('Expected 404 response')
109 109
 
@@ -113,7 +113,7 @@ def test_view(self):
113 113
         Refs #2879.
114 114
         """
115 115
         f = self.urlopen('/example_view/')
116  
-        self.assertEquals(f.read(), 'example view')
  116
+        self.assertEqual(f.read(), 'example view')
117 117
 
118 118
     def test_static_files(self):
119 119
         """
@@ -121,7 +121,7 @@ def test_static_files(self):
121 121
         Refs #2879.
122 122
         """
123 123
         f = self.urlopen('/static/example_static_file.txt')
124  
-        self.assertEquals(f.read(), 'example static file\n')
  124
+        self.assertEqual(f.read(), 'example static file\n')
125 125
 
126 126
     def test_media_files(self):
127 127
         """
@@ -129,7 +129,7 @@ def test_media_files(self):
129 129
         Refs #2879.
130 130
         """
131 131
         f = self.urlopen('/media/example_media_file.txt')
132  
-        self.assertEquals(f.read(), 'example media file\n')
  132
+        self.assertEqual(f.read(), 'example media file\n')
133 133
 
134 134
 
135 135
 class LiveServerDatabase(LiveServerBase):
@@ -141,7 +141,7 @@ def test_fixtures_loaded(self):
141 141
         Refs #2879.
142 142
         """
143 143
         f = self.urlopen('/model_view/')
144  
-        self.assertEquals(f.read().splitlines(), ['jane', 'robert'])
  144
+        self.assertEqual(f.read().splitlines(), ['jane', 'robert'])
145 145
 
146 146
     def test_database_writes(self):
147 147
         """
4  tests/regressiontests/settings_tests/tests.py
@@ -19,10 +19,10 @@ def test_method_override(self):
19 19
         self.assertEqual(settings.TEST, 'override2')
20 20
 
21 21
     def test_decorated_testcase_name(self):
22  
-        self.assertEquals(FullyDecoratedTranTestCase.__name__, 'FullyDecoratedTranTestCase')
  22
+        self.assertEqual(FullyDecoratedTranTestCase.__name__, 'FullyDecoratedTranTestCase')
23 23
 
24 24
     def test_decorated_testcase_module(self):
25  
-        self.assertEquals(FullyDecoratedTranTestCase.__module__, __name__)
  25
+        self.assertEqual(FullyDecoratedTranTestCase.__module__, __name__)
26 26
 
27 27
 
28 28
 @override_settings(TEST='override')
10  tests/regressiontests/test_client_regress/models.py
@@ -956,23 +956,23 @@ class ReadLimitedStreamTest(TestCase):
956 956
     def test_body_from_empty_request(self):
957 957
         """HttpRequest.body on a test client GET request should return
958 958
         the empty string."""
959  
-        self.assertEquals(self.client.get("/test_client_regress/body/").content, '')
  959
+        self.assertEqual(self.client.get("/test_client_regress/body/").content, '')
960 960
 
961 961
     def test_read_from_empty_request(self):
962 962
         """HttpRequest.read() on a test client GET request should return the
963 963
         empty string."""
964  
-        self.assertEquals(self.client.get("/test_client_regress/read_all/").content, '')
  964
+        self.assertEqual(self.client.get("/test_client_regress/read_all/").content, '')
965 965
 
966 966
     def test_read_numbytes_from_empty_request(self):
967 967
         """HttpRequest.read(LARGE_BUFFER) on a test client GET request should
968 968
         return the empty string."""
969  
-        self.assertEquals(self.client.get("/test_client_regress/read_buffer/").content, '')
  969
+        self.assertEqual(self.client.get("/test_client_regress/read_buffer/").content, '')
970 970
 
971 971
     def test_read_from_nonempty_request(self):
972 972
         """HttpRequest.read() on a test client PUT request with some payload
973 973
         should return that payload."""
974 974
         payload = 'foobar'
975  
-        self.assertEquals(self.client.put("/test_client_regress/read_all/",
  975
+        self.assertEqual(self.client.put("/test_client_regress/read_all/",
976 976
                                           data=payload,
977 977
                                           content_type='text/plain').content, payload)
978 978
 
@@ -980,7 +980,7 @@ def test_read_numbytes_from_nonempty_request(self):
980 980
         """HttpRequest.read(LARGE_BUFFER) on a test client PUT request with
981 981
         some payload should return that payload."""
982 982
         payload = 'foobar'
983  
-        self.assertEquals(self.client.put("/test_client_regress/read_buffer/",
  983
+        self.assertEqual(self.client.put("/test_client_regress/read_buffer/",
984 984
                                           data=payload,
985 985
                                           content_type='text/plain').content, payload)
986 986
 
4  tests/regressiontests/test_runner/tests.py
@@ -296,11 +296,11 @@ class AutoIncrementResetTest(TransactionTestCase):
296 296
                      "tests")
297 297
     def test_autoincrement_reset1(self):
298 298
         p = Person.objects.create(first_name='Jack', last_name='Smith')
299  
-        self.assertEquals(p.pk, 1)
  299
+        self.assertEqual(p.pk, 1)
300 300
 
301 301
     @unittest.skipIf(connection.vendor == 'oracle',
302 302
                      "Oracle's auto-increment fields are not reset between "
303 303
                      "tests")
304 304
     def test_autoincrement_reset2(self):
305 305
         p = Person.objects.create(first_name='Jack', last_name='Smith')
306  
-        self.assertEquals(p.pk, 1)
  306
+        self.assertEqual(p.pk, 1)
4  tests/regressiontests/utils/feedgenerator.py
@@ -100,12 +100,12 @@ def test_rss_mime_type(self):
100 100
 
101 101
     def test_feed_without_feed_url_gets_rendered_without_atom_link(self):
102 102
         feed = feedgenerator.Rss201rev2Feed('title', '/link/', 'descr')
103  
-        self.assertEquals(feed.feed['feed_url'], None)
  103
+        self.assertEqual(feed.feed['feed_url'], None)
104 104
         feed_content = feed.writeString('utf-8')
105 105
         self.assertNotIn('<atom:link href=', feed_content)
106 106
 
107 107
     def test_feed_with_feed_url_gets_rendered_with_atom_link(self):
108 108
         feed = feedgenerator.Rss201rev2Feed('title', '/link/', 'descr', feed_url='/feed/')
109  
-        self.assertEquals(feed.feed['feed_url'], '/feed/')
  109
+        self.assertEqual(feed.feed['feed_url'], '/feed/')
110 110
         feed_content = feed.writeString('utf-8')
111 111
         self.assertIn('<atom:link href="/feed/" rel="self"></atom:link>', feed_content)

0 notes on commit b52672d

Please sign in to comment.
Something went wrong with that request. Please try again.