kopia lustrzana https://github.com/wagtail/wagtail
Add missing wagtailadmin_tags in workflow_state_approved.html template
rodzic
999f9ef579
commit
8801a49da8
|
@ -86,6 +86,7 @@ Changelog
|
||||||
* Fix: Center-align StreamField and rich text block picker buttons with the dotted guide line (Thibaud Colas)
|
* Fix: Center-align StreamField and rich text block picker buttons with the dotted guide line (Thibaud Colas)
|
||||||
* Fix: Search bar in chooser modals now performs autocomplete searches under PostgreSQL (Matt Westcott)
|
* Fix: Search bar in chooser modals now performs autocomplete searches under PostgreSQL (Matt Westcott)
|
||||||
* Fix: Server-side document filenames are preserved when replacing a document file (Suyash Singh, Matt Westcott)
|
* Fix: Server-side document filenames are preserved when replacing a document file (Suyash Singh, Matt Westcott)
|
||||||
|
* Fix: Add missing wagtailadmin_tags in `workflow_state_approved.html` template (Alex Tomkins)
|
||||||
* Docs: Add custom permissions section to permissions documentation page (Dan Hayden)
|
* Docs: Add custom permissions section to permissions documentation page (Dan Hayden)
|
||||||
* Docs: Add documentation for how to get started with contributing translations for the Wagtail admin (Ogunbanjo Oluwadamilare)
|
* Docs: Add documentation for how to get started with contributing translations for the Wagtail admin (Ogunbanjo Oluwadamilare)
|
||||||
* Docs: Officially recommend `fnm` over `nvm` in development documentation (LB (Ben) Johnston)
|
* Docs: Officially recommend `fnm` over `nvm` in development documentation (LB (Ben) Johnston)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends 'wagtailadmin/notifications/base.html' %}
|
{% extends 'wagtailadmin/notifications/base.html' %}
|
||||||
{% load i18n %}
|
{% load i18n wagtailadmin_tags %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if page %}
|
{% if page %}
|
||||||
|
|
|
@ -1306,6 +1306,10 @@ class TestSubmitPageToWorkflow(BasePageWorkflowTests):
|
||||||
)
|
)
|
||||||
self.assertIn("http://admin.example.com/admin/", workflow_message.body)
|
self.assertIn("http://admin.example.com/admin/", workflow_message.body)
|
||||||
|
|
||||||
|
@override_settings(WAGTAILADMIN_NOTIFICATION_USE_HTML=True)
|
||||||
|
def test_submit_sends_html_mail(self):
|
||||||
|
self.test_submit_sends_mail()
|
||||||
|
|
||||||
@override_settings(WAGTAILADMIN_BASE_URL=None)
|
@override_settings(WAGTAILADMIN_BASE_URL=None)
|
||||||
def test_submit_sends_mail_without_base_url(self):
|
def test_submit_sends_mail_without_base_url(self):
|
||||||
# With a missing WAGTAILADMIN_BASE_URL setting, we won't be able to construct absolute URLs
|
# With a missing WAGTAILADMIN_BASE_URL setting, we won't be able to construct absolute URLs
|
||||||
|
@ -1338,6 +1342,10 @@ class TestSubmitPageToWorkflow(BasePageWorkflowTests):
|
||||||
workflow_message.body,
|
workflow_message.body,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@override_settings(WAGTAILADMIN_NOTIFICATION_USE_HTML=True)
|
||||||
|
def test_submit_sends_html_mail_without_base_url(self):
|
||||||
|
self.test_submit_sends_mail_without_base_url()
|
||||||
|
|
||||||
@mock.patch.object(
|
@mock.patch.object(
|
||||||
EmailMultiAlternatives, "send", side_effect=IOError("Server down")
|
EmailMultiAlternatives, "send", side_effect=IOError("Server down")
|
||||||
)
|
)
|
||||||
|
@ -1414,13 +1422,30 @@ class TestSubmitPageToWorkflow(BasePageWorkflowTests):
|
||||||
# Submit
|
# Submit
|
||||||
self.post("submit")
|
self.post("submit")
|
||||||
|
|
||||||
msg_headers = set(mail.outbox[0].message().items())
|
message = mail.outbox[0].message()
|
||||||
|
msg_headers = set(message.items())
|
||||||
headers = {("Auto-Submitted", "auto-generated")}
|
headers = {("Auto-Submitted", "auto-generated")}
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
headers.issubset(msg_headers),
|
headers.issubset(msg_headers),
|
||||||
msg="Message is missing the Auto-Submitted header.",
|
msg="Message is missing the Auto-Submitted header.",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self.assertFalse(message.is_multipart())
|
||||||
|
|
||||||
|
@override_settings(WAGTAILADMIN_NOTIFICATION_USE_HTML=True)
|
||||||
|
def test_html_email_headers(self):
|
||||||
|
self.post("submit")
|
||||||
|
|
||||||
|
message = mail.outbox[0].message()
|
||||||
|
msg_headers = set(message.items())
|
||||||
|
headers = {("Auto-Submitted", "auto-generated")}
|
||||||
|
self.assertTrue(
|
||||||
|
headers.issubset(msg_headers),
|
||||||
|
msg="Message is missing the Auto-Submitted header.",
|
||||||
|
)
|
||||||
|
|
||||||
|
self.assertTrue(mail.outbox[0].message().is_multipart())
|
||||||
|
|
||||||
|
|
||||||
class TestSubmitSnippetToWorkflow(TestSubmitPageToWorkflow, BaseSnippetWorkflowTests):
|
class TestSubmitSnippetToWorkflow(TestSubmitPageToWorkflow, BaseSnippetWorkflowTests):
|
||||||
pass
|
pass
|
||||||
|
@ -2425,6 +2450,11 @@ class TestPageNotificationPreferences(BasePageWorkflowTests):
|
||||||
self.assertEqual(len(workflow_rejected_emails), 0)
|
self.assertEqual(len(workflow_rejected_emails), 0)
|
||||||
|
|
||||||
|
|
||||||
|
@override_settings(WAGTAILADMIN_NOTIFICATION_USE_HTML=True)
|
||||||
|
class TestPageNotificationPreferencesHTML(TestPageNotificationPreferences):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class TestSnippetNotificationPreferences(
|
class TestSnippetNotificationPreferences(
|
||||||
TestPageNotificationPreferences, BaseSnippetWorkflowTests
|
TestPageNotificationPreferences, BaseSnippetWorkflowTests
|
||||||
):
|
):
|
||||||
|
@ -2436,6 +2466,11 @@ class TestSnippetNotificationPreferences(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@override_settings(WAGTAILADMIN_NOTIFICATION_USE_HTML=True)
|
||||||
|
class TestSnippetNotificationPreferencesHTML(TestSnippetNotificationPreferences):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class TestDisableViews(BasePageWorkflowTests):
|
class TestDisableViews(BasePageWorkflowTests):
|
||||||
def test_disable_workflow(self):
|
def test_disable_workflow(self):
|
||||||
"""Test that deactivating a workflow sets it to inactive and cancels in progress states"""
|
"""Test that deactivating a workflow sets it to inactive and cancels in progress states"""
|
||||||
|
|
Ładowanie…
Reference in New Issue