Fix admin message auto-dismiss and Category plural label
Admin messages now auto-clear after 8 seconds via the w-messages Stimulus controller's autoClear value, preventing message pile-up. Category model gains verbose_name_plural so Wagtail shows "Categories" instead of "Categorys" in the snippets menu. Closes #62 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -76,3 +76,21 @@ def test_wagtail_admin_template_deduplicates_consecutive_messages(client, django
|
||||
assert response.status_code == 200
|
||||
assert content.count("has been updated.") == 1
|
||||
assert content.count("has been published.") == 1
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
@override_settings(ROOT_URLCONF="apps.core.tests.test_message_handling")
|
||||
def test_admin_messages_have_auto_clear(client, django_user_model):
|
||||
"""The messages container must set auto-clear so messages dismiss themselves."""
|
||||
admin = django_user_model.objects.create_superuser(
|
||||
username="admin-autoclear",
|
||||
email="admin-autoclear@example.com",
|
||||
password="admin-pass",
|
||||
)
|
||||
client.force_login(admin)
|
||||
|
||||
response = client.get("/cms/__tests__/admin-messages/")
|
||||
content = response.content.decode()
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "data-w-messages-auto-clear-value" in content
|
||||
|
||||
Reference in New Issue
Block a user