Skip to content

Commit 99a6524

Browse files
nickmoretonclaude
andcommitted
Update image chooser tests for Wagtail 7's default_alt_text response key
Wagtail 7.x adds a default_alt_text field to the image chooser chosen-step response payload (sourced from the new Image.description model field). The three TestImageChosenView assertions exhaustively compared the JSON response, so they regressed once Wagtail started emitting the extra key. Allow the new key with mock.ANY, matching the existing handling of the preview value. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a2b02b3 commit 99a6524

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/test_image_chooser_views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def test_creates_image_if_asset_id_not_recognised(self):
5151
"title": image.title,
5252
"preview": mock.ANY,
5353
"edit_url": reverse("wagtailimages:edit", args=[image.id]),
54+
"default_alt_text": mock.ANY,
5455
},
5556
},
5657
)
@@ -78,6 +79,7 @@ def test_uses_existing_image_without_updating(self, update_object_mock):
7879
"title": image.title,
7980
"preview": mock.ANY,
8081
"edit_url": reverse("wagtailimages:edit", args=[image.id]),
82+
"default_alt_text": mock.ANY,
8183
},
8284
},
8385
)
@@ -105,6 +107,7 @@ def test_uses_existing_image_and_updates_it(self, update_object_mock):
105107
"title": image.title,
106108
"preview": mock.ANY,
107109
"edit_url": reverse("wagtailimages:edit", args=[image.id]),
110+
"default_alt_text": mock.ANY,
108111
},
109112
},
110113
)

0 commit comments

Comments
 (0)