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: 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: 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 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) | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| {% extends 'wagtailadmin/notifications/base.html' %} | ||||
| {% load i18n %} | ||||
| {% load i18n wagtailadmin_tags %} | ||||
| 
 | ||||
| {% block content %} | ||||
|     {% if page %} | ||||
|  |  | |||
|  | @ -1306,6 +1306,10 @@ class TestSubmitPageToWorkflow(BasePageWorkflowTests): | |||
|         ) | ||||
|         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) | ||||
|     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 | ||||
|  | @ -1338,6 +1342,10 @@ class TestSubmitPageToWorkflow(BasePageWorkflowTests): | |||
|             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( | ||||
|         EmailMultiAlternatives, "send", side_effect=IOError("Server down") | ||||
|     ) | ||||
|  | @ -1414,13 +1422,30 @@ class TestSubmitPageToWorkflow(BasePageWorkflowTests): | |||
|         # 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")} | ||||
|         self.assertTrue( | ||||
|             headers.issubset(msg_headers), | ||||
|             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): | ||||
|     pass | ||||
|  | @ -2425,6 +2450,11 @@ class TestPageNotificationPreferences(BasePageWorkflowTests): | |||
|         self.assertEqual(len(workflow_rejected_emails), 0) | ||||
| 
 | ||||
| 
 | ||||
| @override_settings(WAGTAILADMIN_NOTIFICATION_USE_HTML=True) | ||||
| class TestPageNotificationPreferencesHTML(TestPageNotificationPreferences): | ||||
|     pass | ||||
| 
 | ||||
| 
 | ||||
| class TestSnippetNotificationPreferences( | ||||
|     TestPageNotificationPreferences, BaseSnippetWorkflowTests | ||||
| ): | ||||
|  | @ -2436,6 +2466,11 @@ class TestSnippetNotificationPreferences( | |||
|         ) | ||||
| 
 | ||||
| 
 | ||||
| @override_settings(WAGTAILADMIN_NOTIFICATION_USE_HTML=True) | ||||
| class TestSnippetNotificationPreferencesHTML(TestSnippetNotificationPreferences): | ||||
|     pass | ||||
| 
 | ||||
| 
 | ||||
| class TestDisableViews(BasePageWorkflowTests): | ||||
|     def test_disable_workflow(self): | ||||
|         """Test that deactivating a workflow sets it to inactive and cancels in progress states""" | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 Alex Tomkins
						Alex Tomkins