diff --git a/tests/data/email_dashboard_url/email_dashboard_url.bpmn b/tests/data/email_dashboard_url/email_dashboard_url.bpmn new file mode 100644 index 00000000..ce75e589 --- /dev/null +++ b/tests/data/email_dashboard_url/email_dashboard_url.bpmn @@ -0,0 +1,53 @@ + + + + + Flow_0c51a4b + + + + + Flow_1rfvzi5 + + + + Flow_0c51a4b + Flow_1ker6ik + dashboard_url = get_dashboard_url() + + + <a href="{{dashboard_url}}">{{dashboard_url}}</a> + Flow_1ker6ik + Flow_1rfvzi5 + email(subject='My Email Subject', recipients="test@example.com") + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/test_get_dashboard_url_script.py b/tests/test_get_dashboard_url_script.py index a464400d..988c4909 100644 --- a/tests/test_get_dashboard_url_script.py +++ b/tests/test_get_dashboard_url_script.py @@ -1,7 +1,17 @@ from tests.base_test import BaseTest +from crc import app, mail class TestGetDashboardURL(BaseTest): def test_get_dashboard_url(self): - pass + with mail.record_messages() as outbox: + + dashboard_url = f'http://{app.config["FRONTEND"]}' + workflow = self.create_workflow('email_dashboard_url') + self.get_workflow_api(workflow) + + self.assertEqual(1, len(outbox)) + self.assertEqual('My Email Subject', outbox[0].subject) + self.assertEqual(['test@example.com'], outbox[0].recipients) + self.assertIn(dashboard_url, outbox[0].body)