Skip to content

Commit

Permalink
Replace deprecated assertEquals with assertEqual
Browse files Browse the repository at this point in the history
  • Loading branch information
marteinn committed Dec 30, 2023
1 parent 0b0a8ca commit d139a98
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Changed
### Fixed
- Upgrade python version in example environment and resolve build issues
- Replace deprecated assertEquals with assertEqual

### Removed
- Drop EOL Python 3.7 support (@marteinn)
Expand Down
16 changes: 8 additions & 8 deletions tests/test_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,26 @@ def test_manager(self):
sub_sub_page = TestPage(title="sub_sub_page")
sub_page.add_child(instance=sub_sub_page)

self.assertEquals(TestPage.objects.count(), 3)
self.assertEquals(TestPage.objects_excluding_bins.count(), 3)
self.assertEqual(TestPage.objects.count(), 3)
self.assertEqual(TestPage.objects_excluding_bins.count(), 3)

with self.register_hook("before_delete_page", trash_delete):
delete_url = reverse("wagtailadmin_pages:delete", args=(sub_sub_page.id,))
self.client.post(delete_url)

self.assertEquals(TestPage.objects.count(), 3)
self.assertEquals(TestPage.objects_excluding_bins.count(), 2)
self.assertEqual(TestPage.objects.count(), 3)
self.assertEqual(TestPage.objects_excluding_bins.count(), 2)

with self.register_hook("register_admin_urls", urlconf_time):
restore_url = reverse("wagtail_trash_restore", args=(sub_sub_page.id,))
self.client.get(restore_url)

self.assertEquals(TestPage.objects.count(), 3)
self.assertEquals(TestPage.objects_excluding_bins.count(), 3)
self.assertEqual(TestPage.objects.count(), 3)
self.assertEqual(TestPage.objects_excluding_bins.count(), 3)

with self.register_hook("before_delete_page", trash_delete):
delete_url = reverse("wagtailadmin_pages:delete", args=(top_page.id,))
self.client.post(delete_url)

self.assertEquals(TestPage.objects.count(), 3)
self.assertEquals(TestPage.objects_excluding_bins.count(), 0)
self.assertEqual(TestPage.objects.count(), 3)
self.assertEqual(TestPage.objects_excluding_bins.count(), 0)
4 changes: 2 additions & 2 deletions tests/test_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class TestPermissions(TestCase, WagtailTestUtils):
# resp = self.client.get(index_url)
# html = str(resp.content)

# self.assertEquals(html.count("data-object-pk"), 0)
# self.assertEqual(html.count("data-object-pk"), 0)

# with self.register_hook("before_delete_page", trash_delete):
# delete_url = reverse("wagtailadmin_pages:delete", args=(self.top_page.id,))
Expand All @@ -78,4 +78,4 @@ class TestPermissions(TestCase, WagtailTestUtils):
# html = str(resp.content)
# print(html)

# self.assertEquals(html.count("data-object-pk"), 1)
# self.assertEqual(html.count("data-object-pk"), 1)

0 comments on commit d139a98

Please sign in to comment.