Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Replaced deprecated TestCase methods. Refs #17049.

  • Loading branch information...
commit b52672d77822e88752cb178c8a359adde83ff0ba 1 parent e84f79f
@claudep claudep authored
View
2  django/contrib/auth/tests/management.py
@@ -50,7 +50,7 @@ def test_that_changepassword_command_changes_joes_password(self):
command.execute("joe", stdout=self.stdout)
command_output = self.stdout.getvalue().strip()
- self.assertEquals(command_output, "Changing password for user 'joe'\nPassword changed successfully for user 'joe'")
+ self.assertEqual(command_output, "Changing password for user 'joe'\nPassword changed successfully for user 'joe'")
self.assertTrue(models.User.objects.get(username="joe").check_password("not qwerty"))
def test_that_max_tries_exits_1(self):
View
22 django/contrib/auth/tests/models.py
@@ -46,12 +46,12 @@ class NaturalKeysTestCase(TestCase):
def test_user_natural_key(self):
staff_user = User.objects.get(username='staff')
- self.assertEquals(User.objects.get_by_natural_key('staff'), staff_user)
- self.assertEquals(staff_user.natural_key(), ('staff',))
+ self.assertEqual(User.objects.get_by_natural_key('staff'), staff_user)
+ self.assertEqual(staff_user.natural_key(), ('staff',))
def test_group_natural_key(self):
users_group = Group.objects.create(name='users')
- self.assertEquals(Group.objects.get_by_natural_key('users'), users_group)
+ self.assertEqual(Group.objects.get_by_natural_key('users'), users_group)
@override_settings(USE_TZ=False)
@@ -61,7 +61,7 @@ class LoadDataWithoutNaturalKeysTestCase(TestCase):
def test_user_is_created_and_added_to_group(self):
user = User.objects.get(username='my_username')
group = Group.objects.get(name='my_group')
- self.assertEquals(group, user.groups.get())
+ self.assertEqual(group, user.groups.get())
@override_settings(USE_TZ=False)
@@ -71,7 +71,7 @@ class LoadDataWithNaturalKeysTestCase(TestCase):
def test_user_is_created_and_added_to_group(self):
user = User.objects.get(username='my_username')
group = Group.objects.get(name='my_group')
- self.assertEquals(group, user.groups.get())
+ self.assertEqual(group, user.groups.get())
class UserManagerTestCase(TestCase):
@@ -79,23 +79,23 @@ class UserManagerTestCase(TestCase):
def test_create_user(self):
email_lowercase = 'normal@normal.com'
user = User.objects.create_user('user', email_lowercase)
- self.assertEquals(user.email, email_lowercase)
- self.assertEquals(user.username, 'user')
- self.assertEquals(user.password, '!')
+ self.assertEqual(user.email, email_lowercase)
+ self.assertEqual(user.username, 'user')
+ self.assertEqual(user.password, '!')
def test_create_user_email_domain_normalize_rfc3696(self):
# According to http://tools.ietf.org/html/rfc3696#section-3
# the "@" symbol can be part of the local part of an email address
returned = UserManager.normalize_email(r'Abc\@DEF@EXAMPLE.com')
- self.assertEquals(returned, r'Abc\@DEF@example.com')
+ self.assertEqual(returned, r'Abc\@DEF@example.com')
def test_create_user_email_domain_normalize(self):
returned = UserManager.normalize_email('normal@DOMAIN.COM')
- self.assertEquals(returned, 'normal@domain.com')
+ self.assertEqual(returned, 'normal@domain.com')
def test_create_user_email_domain_normalize_with_whitespace(self):
returned = UserManager.normalize_email('email\ with_whitespace@D.COM')
- self.assertEquals(returned, 'email\ with_whitespace@d.com')
+ self.assertEqual(returned, 'email\ with_whitespace@d.com')
def test_empty_username(self):
self.assertRaisesMessage(ValueError,
View
6 django/contrib/formtools/tests/wizard/wizardtests/tests.py
@@ -303,7 +303,7 @@ def get_context_data(self, **kwargs):
view = TestWizard.as_view([forms.Form])
response = view(factory.get('/'))
- self.assertEquals(response.context_data['test_key'], 'test_value')
+ self.assertEqual(response.context_data['test_key'], 'test_value')
def test_get_context_data_with_mixin(self):
class AnotherMixin(object):
@@ -329,8 +329,8 @@ def get_context_data(self, **kwargs):
view = TestWizard.as_view([forms.Form])
response = view(factory.get('/'))
- self.assertEquals(response.context_data['test_key'], 'test_value')
- self.assertEquals(response.context_data['another_key'], 'another_value')
+ self.assertEqual(response.context_data['test_key'], 'test_value')
+ self.assertEqual(response.context_data['another_key'], 'another_value')
class WizardFormKwargsOverrideTests(TestCase):
View
2  django/contrib/gis/geoip/tests.py
@@ -87,7 +87,7 @@ def test04_city(self):
self.assertEqual('TX', d['region'])
self.assertEqual(713, d['area_code'])
geom = g.geos(query)
- self.failIf(not isinstance(geom, GEOSGeometry))
+ self.assertTrue(isinstance(geom, GEOSGeometry))
lon, lat = (-95.4010, 29.7079)
lat_lon = g.lat_lon(query)
lat_lon = (lat_lon[1], lat_lon[0])
View
8 django/contrib/gis/tests/test_measure.py
@@ -45,7 +45,7 @@ def testAccess(self):
def testAccessInvalid(self):
"Testing access in invalid units"
d = D(m=100)
- self.failIf(hasattr(d, 'banana'))
+ self.assertFalse(hasattr(d, 'banana'))
def testAddition(self):
"Test addition & subtraction"
@@ -133,7 +133,7 @@ def testComparisons(self):
self.assertTrue(d2 > d1)
self.assertTrue(d1 == d1)
self.assertTrue(d1 < d2)
- self.failIf(d3)
+ self.assertFalse(d3)
def testUnitsStr(self):
"Testing conversion to strings"
@@ -179,7 +179,7 @@ def testAccess(self):
def testAccessInvaliA(self):
"Testing access in invalid units"
a = A(sq_m=100)
- self.failIf(hasattr(a, 'banana'))
+ self.assertFalse(hasattr(a, 'banana'))
def testAddition(self):
"Test addition & subtraction"
@@ -267,7 +267,7 @@ def testComparisons(self):
self.assertTrue(a2 > a1)
self.assertTrue(a1 == a1)
self.assertTrue(a1 < a2)
- self.failIf(a3)
+ self.assertFalse(a3)
def testUnitsStr(self):
"Testing conversion to strings"
View
12 tests/modeltests/prefetch_related/tests.py
@@ -341,7 +341,7 @@ def test_foreignkey(self):
qs = AuthorWithAge.objects.prefetch_related('addresses')
addresses = [[unicode(address) for address in obj.addresses.all()]
for obj in qs]
- self.assertEquals(addresses, [[unicode(self.authorAddress)], [], []])
+ self.assertEqual(addresses, [[unicode(self.authorAddress)], [], []])
def test_m2m_to_inheriting_model(self):
qs = AuthorWithAge.objects.prefetch_related('books_with_year')
@@ -351,7 +351,7 @@ def test_m2m_to_inheriting_model(self):
qs = AuthorWithAge.objects.all()
lst2 = [[unicode(book) for book in author.books_with_year.all()]
for author in qs]
- self.assertEquals(lst, lst2)
+ self.assertEqual(lst, lst2)
qs = BookWithYear.objects.prefetch_related('aged_authors')
with self.assertNumQueries(2):
@@ -360,7 +360,7 @@ def test_m2m_to_inheriting_model(self):
qs = BookWithYear.objects.all()
lst2 = [[unicode(author) for author in book.aged_authors.all()]
for book in qs]
- self.assertEquals(lst, lst2)
+ self.assertEqual(lst, lst2)
def test_parent_link_prefetch(self):
with self.assertNumQueries(2):
@@ -402,7 +402,7 @@ def test_foreignkey(self):
qs = Author.objects.prefetch_related('addresses')
addresses = [[unicode(address) for address in obj.addresses.all()]
for obj in qs]
- self.assertEquals(addresses, [[unicode(self.authorAddress)], [], []])
+ self.assertEqual(addresses, [[unicode(self.authorAddress)], [], []])
def test_m2m(self):
with self.assertNumQueries(3):
@@ -411,7 +411,7 @@ def test_m2m(self):
[unicode(i_like) for i_like in author.favorite_authors.all()],
[unicode(likes_me) for likes_me in author.favors_me.all()]
) for author in qs]
- self.assertEquals(
+ self.assertEqual(
favorites,
[
([unicode(self.author2)],[unicode(self.author3)]),
@@ -549,7 +549,7 @@ def test_using_is_honored_m2m(self):
authors = "".join(["%s: %s\n" %
(author.name, ", ".join(b.title for b in author.books.all()))
for author in qs2])
- self.assertEquals(authors,
+ self.assertEqual(authors,
"Charlotte: Poems, Jane Eyre\n"
"Anne: Poems\n"
"Emily: Poems, Wuthering Heights\n"
View
4 tests/modeltests/select_for_update/tests.py
@@ -80,7 +80,7 @@ def has_for_update_sql(self, tested_connection, nowait=False):
return bool(sql.find(for_update_sql) > -1)
def check_exc(self, exc):
- self.failUnless(isinstance(exc, DatabaseError))
+ self.assertTrue(isinstance(exc, DatabaseError))
@skipUnlessDBFeature('has_select_for_update')
def test_for_update_sql_generated(self):
@@ -217,7 +217,7 @@ def test_block(self):
# Check the thread has finished. Assuming it has, we should
# find that it has updated the person's name.
- self.failIf(thread.isAlive())
+ self.assertFalse(thread.isAlive())
# We must commit the transaction to ensure that MySQL gets a fresh read,
# since by default it runs in REPEATABLE READ mode
View
4 tests/modeltests/test_client/models.py
@@ -378,7 +378,7 @@ def test_view_with_permissions_exception(self):
# Get the page without logging in. Should result in 403.
response = self.client.get('/test_client/permission_protected_view_exception/')
- self.assertEquals(response.status_code, 403)
+ self.assertEqual(response.status_code, 403)
# Log in
login = self.client.login(username='testclient', password='password')
@@ -386,7 +386,7 @@ def test_view_with_permissions_exception(self):
# Log in with wrong permissions. Should result in 403.
response = self.client.get('/test_client/permission_protected_view_exception/')
- self.assertEquals(response.status_code, 403)
+ self.assertEqual(response.status_code, 403)
def test_view_with_method_permissions(self):
"Request a page that is protected with a @permission_required method"
View
10 tests/regressiontests/admin_filters/tests.py
@@ -270,7 +270,7 @@ def test_relatedfieldlistfilter_foreignkey(self):
# Make sure the last choice is None and is selected
filterspec = changelist.get_filters(request)[0][1]
- self.assertEquals(force_unicode(filterspec.title), u'Verbose Author')
+ self.assertEqual(force_unicode(filterspec.title), u'Verbose Author')
choices = list(filterspec.choices(changelist))
self.assertEqual(choices[-1]['selected'], True)
self.assertEqual(choices[-1]['query_string'], '?author__isnull=True')
@@ -280,7 +280,7 @@ def test_relatedfieldlistfilter_foreignkey(self):
# Make sure the correct choice is selected
filterspec = changelist.get_filters(request)[0][1]
- self.assertEquals(force_unicode(filterspec.title), u'Verbose Author')
+ self.assertEqual(force_unicode(filterspec.title), u'Verbose Author')
# order of choices depends on User model, which has no order
choice = select_by(filterspec.choices(changelist), "display", "alfred")
self.assertEqual(choice['selected'], True)
@@ -298,7 +298,7 @@ def test_relatedfieldlistfilter_manytomany(self):
# Make sure the last choice is None and is selected
filterspec = changelist.get_filters(request)[0][2]
- self.assertEquals(force_unicode(filterspec.title), u'Verbose Contributors')
+ self.assertEqual(force_unicode(filterspec.title), u'Verbose Contributors')
choices = list(filterspec.choices(changelist))
self.assertEqual(choices[-1]['selected'], True)
self.assertEqual(choices[-1]['query_string'], '?contributors__isnull=True')
@@ -308,7 +308,7 @@ def test_relatedfieldlistfilter_manytomany(self):
# Make sure the correct choice is selected
filterspec = changelist.get_filters(request)[0][2]
- self.assertEquals(force_unicode(filterspec.title), u'Verbose Contributors')
+ self.assertEqual(force_unicode(filterspec.title), u'Verbose Contributors')
choice = select_by(filterspec.choices(changelist), "display", "bob")
self.assertEqual(choice['selected'], True)
self.assertEqual(choice['query_string'], '?contributors__id__exact=%d' % self.bob.pk)
@@ -509,7 +509,7 @@ def test_simplelistfilter(self):
self.assertEqual(choices[3]['query_string'], '?publication-decade=the+00s&author__id__exact=%s' % self.alfred.pk)
filterspec = changelist.get_filters(request)[0][0]
- self.assertEquals(force_unicode(filterspec.title), u'Verbose Author')
+ self.assertEqual(force_unicode(filterspec.title), u'Verbose Author')
choice = select_by(filterspec.choices(changelist), "display", "alfred")
self.assertEqual(choice['selected'], True)
self.assertEqual(choice['query_string'], '?publication-decade=the+00s&author__id__exact=%s' % self.alfred.pk)
View
44 tests/regressiontests/admin_inlines/tests.py
@@ -405,14 +405,14 @@ def test_add_inlines(self):
# Check that there's only one inline to start with and that it has the
# correct ID.
- self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'.dynamic-profile_set')), 1)
- self.failUnlessEqual(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(self.selenium.find_elements_by_css_selector(
'.dynamic-profile_set')[0].get_attribute('id'),
'profile_set-0')
- self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'.dynamic-profile_set#profile_set-0 input[name=profile_set-0-first_name]')), 1)
- self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'.dynamic-profile_set#profile_set-0 input[name=profile_set-0-last_name]')), 1)
# Add an inline
@@ -420,24 +420,24 @@ def test_add_inlines(self):
# Check that the inline has been added, that it has the right id, and
# that it contains the right fields.
- self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'.dynamic-profile_set')), 2)
- self.failUnlessEqual(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(self.selenium.find_elements_by_css_selector(
'.dynamic-profile_set')[1].get_attribute('id'), 'profile_set-1')
- self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'.dynamic-profile_set#profile_set-1 input[name=profile_set-1-first_name]')), 1)
- self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'.dynamic-profile_set#profile_set-1 input[name=profile_set-1-last_name]')), 1)
# Let's add another one to be sure
self.selenium.find_element_by_link_text('Add another Profile').click()
- self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'.dynamic-profile_set')), 3)
- self.failUnlessEqual(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(self.selenium.find_elements_by_css_selector(
'.dynamic-profile_set')[2].get_attribute('id'), 'profile_set-2')
- self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'.dynamic-profile_set#profile_set-2 input[name=profile_set-2-first_name]')), 1)
- self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'.dynamic-profile_set#profile_set-2 input[name=profile_set-2-last_name]')), 1)
# Enter some data and click 'Save'
@@ -473,17 +473,17 @@ def test_delete_inlines(self):
self.selenium.find_element_by_link_text('Add another Profile').click()
self.selenium.find_element_by_link_text('Add another Profile').click()
self.selenium.find_element_by_link_text('Add another Profile').click()
- self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'#profile_set-group table tr.dynamic-profile_set')), 5)
- self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'form#profilecollection_form tr.dynamic-profile_set#profile_set-0')), 1)
- self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'form#profilecollection_form tr.dynamic-profile_set#profile_set-1')), 1)
- self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'form#profilecollection_form tr.dynamic-profile_set#profile_set-2')), 1)
- self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'form#profilecollection_form tr.dynamic-profile_set#profile_set-3')), 1)
- self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'form#profilecollection_form tr.dynamic-profile_set#profile_set-4')), 1)
# Click on a few delete buttons
@@ -492,13 +492,13 @@ def test_delete_inlines(self):
self.selenium.find_element_by_css_selector(
'form#profilecollection_form tr.dynamic-profile_set#profile_set-2 td.delete a').click()
# Verify that they're gone and that the IDs have been re-sequenced
- self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'#profile_set-group table tr.dynamic-profile_set')), 3)
- self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'form#profilecollection_form tr.dynamic-profile_set#profile_set-0')), 1)
- self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'form#profilecollection_form tr.dynamic-profile_set#profile_set-1')), 1)
- self.failUnlessEqual(len(self.selenium.find_elements_by_css_selector(
+ self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'form#profilecollection_form tr.dynamic-profile_set#profile_set-2')), 1)
View
2  tests/regressiontests/admin_views/tests.py
@@ -3144,7 +3144,7 @@ def test_readonly_manytomany(self):
def test_user_password_change_limited_queryset(self):
su = User.objects.filter(is_superuser=True)[0]
response = self.client.get('/test_admin/admin2/auth/user/%s/password/' % su.pk)
- self.assertEquals(response.status_code, 404)
+ self.assertEqual(response.status_code, 404)
@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
View
4 tests/regressiontests/backends/tests.py
@@ -521,7 +521,7 @@ def runner():
t = threading.Thread(target=runner)
t.start()
t.join()
- self.assertEquals(len(connections_set), 3)
+ self.assertEqual(len(connections_set), 3)
# Finish by closing the connections opened by the other threads (the
# connection opened in the main thread will automatically be closed on
# teardown).
@@ -548,7 +548,7 @@ def runner():
t = threading.Thread(target=runner)
t.start()
t.join()
- self.assertEquals(len(connections_set), 6)
+ self.assertEqual(len(connections_set), 6)
# Finish by closing the connections opened by the other threads (the
# connection opened in the main thread will automatically be closed on
# teardown).
View
2  tests/regressiontests/createsuperuser/tests.py
@@ -28,7 +28,7 @@ def test_that_changepassword_command_with_database_option_uses_given_db(self):
command.execute("joe", database='other', stdout=self.stdout)
command_output = self.stdout.getvalue().strip()
- self.assertEquals(command_output, "Changing password for user 'joe'\nPassword changed successfully for user 'joe'")
+ self.assertEqual(command_output, "Changing password for user 'joe'\nPassword changed successfully for user 'joe'")
self.assertTrue(models.User.objects.using('other').get(username="joe").check_password("not qwerty"))
View
6 tests/regressiontests/file_uploads/tests.py
@@ -202,7 +202,7 @@ def test_truncated_multipart_handled_gracefully(self):
'wsgi.input': client.FakePayload(payload),
}
got = json.loads(self.client.request(**r).content)
- self.assertEquals(got, {})
+ self.assertEqual(got, {})
def test_empty_multipart_handled_gracefully(self):
"""
@@ -217,7 +217,7 @@ def test_empty_multipart_handled_gracefully(self):
'wsgi.input': client.FakePayload(''),
}
got = json.loads(self.client.request(**r).content)
- self.assertEquals(got, {})
+ self.assertEqual(got, {})
def test_custom_upload_handler(self):
# A small file (under the 5M quota)
@@ -313,7 +313,7 @@ def handle_uncaught_exception(self, request, resolver, exc_info):
try:
response = self.client.post('/file_uploads/upload_errors/', post_data)
except reference_error.__class__ as err:
- self.failIf(
+ self.assertFalse(
str(err) == str(reference_error),
"Caught a repeated exception that'll cause an infinite loop in file uploads."
)
View
10 tests/regressiontests/servers/tests.py
@@ -103,7 +103,7 @@ def test_404(self):
try:
self.urlopen('/')
except urllib2.HTTPError as err:
- self.assertEquals(err.code, 404, 'Expected 404 response')
+ self.assertEqual(err.code, 404, 'Expected 404 response')
else:
self.fail('Expected 404 response')
@@ -113,7 +113,7 @@ def test_view(self):
Refs #2879.
"""
f = self.urlopen('/example_view/')
- self.assertEquals(f.read(), 'example view')
+ self.assertEqual(f.read(), 'example view')
def test_static_files(self):
"""
@@ -121,7 +121,7 @@ def test_static_files(self):
Refs #2879.
"""
f = self.urlopen('/static/example_static_file.txt')
- self.assertEquals(f.read(), 'example static file\n')
+ self.assertEqual(f.read(), 'example static file\n')
def test_media_files(self):
"""
@@ -129,7 +129,7 @@ def test_media_files(self):
Refs #2879.
"""
f = self.urlopen('/media/example_media_file.txt')
- self.assertEquals(f.read(), 'example media file\n')
+ self.assertEqual(f.read(), 'example media file\n')
class LiveServerDatabase(LiveServerBase):
@@ -141,7 +141,7 @@ def test_fixtures_loaded(self):
Refs #2879.
"""
f = self.urlopen('/model_view/')
- self.assertEquals(f.read().splitlines(), ['jane', 'robert'])
+ self.assertEqual(f.read().splitlines(), ['jane', 'robert'])
def test_database_writes(self):
"""
View
4 tests/regressiontests/settings_tests/tests.py
@@ -19,10 +19,10 @@ def test_method_override(self):
self.assertEqual(settings.TEST, 'override2')
def test_decorated_testcase_name(self):
- self.assertEquals(FullyDecoratedTranTestCase.__name__, 'FullyDecoratedTranTestCase')
+ self.assertEqual(FullyDecoratedTranTestCase.__name__, 'FullyDecoratedTranTestCase')
def test_decorated_testcase_module(self):
- self.assertEquals(FullyDecoratedTranTestCase.__module__, __name__)
+ self.assertEqual(FullyDecoratedTranTestCase.__module__, __name__)
@override_settings(TEST='override')
View
10 tests/regressiontests/test_client_regress/models.py
@@ -956,23 +956,23 @@ class ReadLimitedStreamTest(TestCase):
def test_body_from_empty_request(self):
"""HttpRequest.body on a test client GET request should return
the empty string."""
- self.assertEquals(self.client.get("/test_client_regress/body/").content, '')
+ self.assertEqual(self.client.get("/test_client_regress/body/").content, '')
def test_read_from_empty_request(self):
"""HttpRequest.read() on a test client GET request should return the
empty string."""
- self.assertEquals(self.client.get("/test_client_regress/read_all/").content, '')
+ self.assertEqual(self.client.get("/test_client_regress/read_all/").content, '')
def test_read_numbytes_from_empty_request(self):
"""HttpRequest.read(LARGE_BUFFER) on a test client GET request should
return the empty string."""
- self.assertEquals(self.client.get("/test_client_regress/read_buffer/").content, '')
+ self.assertEqual(self.client.get("/test_client_regress/read_buffer/").content, '')
def test_read_from_nonempty_request(self):
"""HttpRequest.read() on a test client PUT request with some payload
should return that payload."""
payload = 'foobar'
- self.assertEquals(self.client.put("/test_client_regress/read_all/",
+ self.assertEqual(self.client.put("/test_client_regress/read_all/",
data=payload,
content_type='text/plain').content, payload)
@@ -980,7 +980,7 @@ def test_read_numbytes_from_nonempty_request(self):
"""HttpRequest.read(LARGE_BUFFER) on a test client PUT request with
some payload should return that payload."""
payload = 'foobar'
- self.assertEquals(self.client.put("/test_client_regress/read_buffer/",
+ self.assertEqual(self.client.put("/test_client_regress/read_buffer/",
data=payload,
content_type='text/plain').content, payload)
View
4 tests/regressiontests/test_runner/tests.py
@@ -296,11 +296,11 @@ class AutoIncrementResetTest(TransactionTestCase):
"tests")
def test_autoincrement_reset1(self):
p = Person.objects.create(first_name='Jack', last_name='Smith')
- self.assertEquals(p.pk, 1)
+ self.assertEqual(p.pk, 1)
@unittest.skipIf(connection.vendor == 'oracle',
"Oracle's auto-increment fields are not reset between "
"tests")
def test_autoincrement_reset2(self):
p = Person.objects.create(first_name='Jack', last_name='Smith')
- self.assertEquals(p.pk, 1)
+ self.assertEqual(p.pk, 1)
View
4 tests/regressiontests/utils/feedgenerator.py
@@ -100,12 +100,12 @@ def test_rss_mime_type(self):
def test_feed_without_feed_url_gets_rendered_without_atom_link(self):
feed = feedgenerator.Rss201rev2Feed('title', '/link/', 'descr')
- self.assertEquals(feed.feed['feed_url'], None)
+ self.assertEqual(feed.feed['feed_url'], None)
feed_content = feed.writeString('utf-8')
self.assertNotIn('<atom:link href=', feed_content)
def test_feed_with_feed_url_gets_rendered_with_atom_link(self):
feed = feedgenerator.Rss201rev2Feed('title', '/link/', 'descr', feed_url='/feed/')
- self.assertEquals(feed.feed['feed_url'], '/feed/')
+ self.assertEqual(feed.feed['feed_url'], '/feed/')
feed_content = feed.writeString('utf-8')
self.assertIn('<atom:link href="/feed/" rel="self"></atom:link>', feed_content)
Please sign in to comment.
Something went wrong with that request. Please try again.