Skip to content

Commit

Permalink
Replace self.assertEquals with self.assertEqual
Browse files Browse the repository at this point in the history
  • Loading branch information
norkans7 committed Dec 5, 2023
1 parent 884b675 commit efe1d00
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 99 deletions.
14 changes: 7 additions & 7 deletions smartmin/csv_imports/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ def test_csv_import(self):
pass

def test_generate_file_path(self):
self.assertEquals(generate_file_path(ImportTask(), "allo.csv"), "csv_imports/allo.csv")
self.assertEquals(generate_file_path(ImportTask(), "allo.xlsx"), "csv_imports/allo.xlsx")
self.assertEquals(generate_file_path(ImportTask(), "allo.foo.bar"), "csv_imports/allo.foo.bar")
self.assertEqual(generate_file_path(ImportTask(), "allo.csv"), "csv_imports/allo.csv")
self.assertEqual(generate_file_path(ImportTask(), "allo.xlsx"), "csv_imports/allo.xlsx")
self.assertEqual(generate_file_path(ImportTask(), "allo.foo.bar"), "csv_imports/allo.foo.bar")

long_name = "foo" * 100

test_file_name = "%s.xls.csv" % long_name
self.assertEquals(len(generate_file_path(ImportTask(), test_file_name)), 100)
self.assertEquals(generate_file_path(ImportTask(), test_file_name), "csv_imports/%s.csv" % long_name[:84])
self.assertEqual(len(generate_file_path(ImportTask(), test_file_name)), 100)
self.assertEqual(generate_file_path(ImportTask(), test_file_name), "csv_imports/%s.csv" % long_name[:84])

test_file_name = "%s.abc.xlsx" % long_name
self.assertEquals(len(generate_file_path(ImportTask(), test_file_name)), 100)
self.assertEquals(generate_file_path(ImportTask(), test_file_name), "csv_imports/%s.xlsx" % long_name[:83])
self.assertEqual(len(generate_file_path(ImportTask(), test_file_name)), 100)
self.assertEqual(generate_file_path(ImportTask(), test_file_name), "csv_imports/%s.xlsx" % long_name[:83])
8 changes: 4 additions & 4 deletions smartmin/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ def fetch_protected(self, url, user, post_data=None, failOnFormValidation=True):
# but now we can!
if not post_data:
response = self.client.get(url)
self.assertEquals(200, response.status_code)
self.assertEqual(200, response.status_code)
else:
response = self.client.post(url, data=post_data)
self.assertNotRedirect(response, reverse("users.user_login"), msg="Unexpected redirect to login")

if failOnFormValidation:
self.assertNoFormErrors(response, post_data)
self.assertEquals(302, response.status_code)
self.assertEqual(302, response.status_code)

return response

Expand Down Expand Up @@ -162,7 +162,7 @@ def testDelete(self):
return
object = self.getTestObject()
self._do_test_view("delete", object, post_data=dict())
self.assertEquals(0, len(self.getManager().filter(pk=object.pk)))
self.assertEqual(0, len(self.getManager().filter(pk=object.pk)))

def testList(self):
if "list" not in self.getCRUDL().actions:
Expand Down Expand Up @@ -222,7 +222,7 @@ def _do_test_view(self, action=None, object=None, post_data=None, query_string=N
def assertPageGet(self, action, response):
if response.status_code == 302:
self.fail("'%s' resulted in an unexpected redirect to: %s" % (action, response.get("Location")))
self.assertEquals(
self.assertEqual(
200,
response.status_code,
)
Expand Down
Loading

0 comments on commit efe1d00

Please sign in to comment.