Skip to content

Commit

Permalink
Use new signature for assertFormError
Browse files Browse the repository at this point in the history
Skip WagtailTestUtils's shim as we no longer support Django < 4.2
  • Loading branch information
laymonage committed Feb 5, 2024
1 parent e3582e1 commit b70b966
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions wagtail_modeladmin/test/tests/test_simple_modeladmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,9 @@ def test_post_invalid(self):
self.assertEqual(initial_book_count, final_book_count)

# Check that a form error was raised
self.assertFormError(response, "form", "title", "This field is required.")
super(WagtailTestUtils, self).assertFormError(
response.context["form"], "title", "This field is required."
)
self.assertContains(response, "error-message", count=1)

def test_exclude_passed_to_extract_panel_definitions(self):
Expand Down Expand Up @@ -739,7 +741,9 @@ def test_post_invalid(self):
self.assertEqual(Book.objects.get(id=1).title, "The Lord of the Rings")

# Check that a form error was raised
self.assertFormError(response, "form", "title", "This field is required.")
super(WagtailTestUtils, self).assertFormError(
response.context["form"], "title", "This field is required."
)
self.assertContains(response, "error-message", count=1)

def test_exclude_passed_to_extract_panel_definitions(self):
Expand Down

0 comments on commit b70b966

Please sign in to comment.