Merge pull request #417 from sartography/email-data-script-487

get_email_data bug #487
This commit is contained in:
Dan Funk 2021-11-03 14:27:30 -04:00 committed by GitHub
commit aeaacaf21f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -16,7 +16,8 @@ class EmailData(Script):
if 'email_id' in kwargs or 'workflow_spec_id' in kwargs:
subject = 'My Test Email'
recipients = 'user@example.com'
content, content_html = EmailService().get_rendered_content(task.task_spec.documentation, task.data)
content = "Hello"
content_html = "<!DOCTYPE html><html><head></head><body><div><h2>Hello</h2></div></body></html>"
email_model = EmailModel(subject=subject,
recipients=recipients,
content=content,

View File

@ -6,6 +6,12 @@ from crc.services.email_service import EmailService
class TestGetEmailData(BaseTest):
def test_email_data_validation(self):
self.load_example_data()
spec_model = self.load_test_spec('get_email_data')
rv = self.app.get('/v1.0/workflow-specification/%s/validate' % spec_model.id, headers=self.logged_in_headers())
self.assertEqual([], rv.json)
def test_get_email_data_by_email_id(self):
self.load_example_data()
workflow = self.create_workflow('get_email_data')