Removed the test and templates from the unused mails service.

Mails was removed in previous commit.
This commit is contained in:
mike cullerton 2021-03-11 11:34:24 -05:00
parent 67697b5076
commit fa4707811e
13 changed files with 0 additions and 137 deletions

View File

@ -1,2 +0,0 @@
<p>A Research Ramp-up approval request from {{ primary_investigator }} is now available for your review in your
<a href="https://rrt.uvadcos.io/app/approvals">Research Ramp-up Toolkit]</a></p>

View File

@ -1,2 +0,0 @@
A Research Ramp-up approval request from {{ primary_investigator }} is now available for your review in your
Research Ramp-up Toolkit: https://rrt.uvadcos.io/app/approvals.

View File

@ -1,2 +0,0 @@
<p>A Research Ramp-up approval request from {{ primary_investigator }} and is now available for your review in your
<a href="https://rrt.uvadcos.io/app/approvals">Research Ramp-up Toolkit</a>.</p>

View File

@ -1,2 +0,0 @@
A Research Ramp-up approval request from {{ primary_investigator }} is now available for your review in your
Research Ramp-up Toolkit at https://rrt.uvadcos.io/app/approvals.

View File

@ -1 +0,0 @@
<p>Your Research Ramp-up Plan has been approved by {{ approver_1 }} {% if approver_2 %}and {{ approver_2 }} {% endif %}</p>

View File

@ -1 +0,0 @@
Your Research Ramp-up Plan has been approved by {{ approver_1 }} {% if approver_2 %}and {{ approver_2 }} {% endif %}

View File

@ -1 +0,0 @@
<p>Your Research Ramp-up Plan has been denied by {{ approver }}. Please return to the Research Ramp-up Plan application and review the comments from {{ approver }} on the home page. Next, open the application and locate the first step where changes are needed. Continue to complete additional steps saving your work along the way. Review your revised Research Ramp-up Plan and res-submit for approval.</p>

View File

@ -1 +0,0 @@
Your Research Ramp-up Plan has been denied by {{ approver }}. Please return to the Research Ramp-up Plan application and review the comments from {{ approver }} on the home page. Next, open the application and locate the first step where changes are needed. Continue to complete additional steps saving your work along the way. Review your revised Research Ramp-up Plan and res-submit for approval.

View File

@ -1 +0,0 @@
<p>The Research Ramp-up Plan submitted by {{ primary_investigator }} was denied by {{ approver_2 }} and returned for requested updates. You may see comments related to this denial in on your Research Ramp-up Toolkit Approval dashboard.</p>

View File

@ -1 +0,0 @@
The Research Ramp-up Plan submitted by {{ primary_investigator }} was denied by {{ approver_2 }} and returned for requested updates. You may see comments related to this denial in on your Research Ramp-up Toolkit Approval dashboard.

View File

@ -1,5 +0,0 @@
<p>Your Research Ramp-up Plan (RRP) has been submitted for review by {{ approver_1 }} {% if approver_2 %}and {{ approver_2 }} {% endif %}. After completion of the review step you will receive email notification of its approval or if additional information and/or modifications are required, along with instructions on how to proceed. Return to the Research Ramp-up Plan application to proceed as instructed.</p>
<p>In the meantime, please make sure all required training has been completed and needed supplies secured. You will be asked to confirm that both of these requirements have been met before reopening the research space approved in your RRP.</p>
<p>Additionally, if there are any unknown Area Monitors for the spaces listed in your RRP, please contact your approvers to determine either who they are or how you can find out. Missing Area Monitors will need to be entered before proceeding as well.</p>

View File

@ -1,5 +0,0 @@
Your Research Ramp-up Plan (RRP) has been submitted for review by {{ approver_1 }} {% if approver_2 %}and {{ approver_2 }} {% endif %}. After completion of the review step you will receive email notification of its approval or if additional information and/or modifications are required, along with instructions on how to proceed. Return to the Research Ramp-up Plan application to proceed as instructed.
In the meantime, please make sure all required training has been completed and needed supplies secured. You will be asked to confirm that both of these requirements have been met before reopening the research space approved in your RRP.
Additionally, if there are any unknown Area Monitors for the spaces listed in your RRP, please contact your approvers to determine either who they are or how you can find out. Missing Area Monitors will need to be entered before proceeding as well.

View File

@ -1,113 +0,0 @@
from crc import mail
from crc.models.email import EmailModel
from crc.services.mails import (
send_ramp_up_submission_email,
send_ramp_up_approval_request_email,
send_ramp_up_approval_request_first_review_email,
send_ramp_up_approved_email,
send_ramp_up_denied_email,
send_ramp_up_denied_email_to_approver
)
from tests.base_test import BaseTest
class TestMails(BaseTest):
def setUp(self):
"""Initial setup shared by all TestApprovals tests"""
self.load_example_data()
self.study = self.create_study()
self.workflow = self.create_workflow('random_fact')
self.sender = 'sender@sartography.com'
self.recipients = ['recipient@sartography.com']
self.primary_investigator = 'Dr. Bartlett'
self.approver_1 = 'Max Approver'
self.approver_2 = 'Close Reviewer'
def test_send_ramp_up_submission_email(self):
with mail.record_messages() as outbox:
send_ramp_up_submission_email(self.sender, self.recipients, self.approver_1)
self.assertEqual(len(outbox), 1)
self.assertEqual(outbox[0].subject, 'Research Ramp-up Plan Submitted')
self.assertIn(self.approver_1, outbox[0].body)
self.assertIn(self.approver_1, outbox[0].html)
send_ramp_up_submission_email(self.sender, self.recipients, self.approver_1, self.approver_2)
self.assertEqual(len(outbox), 2)
self.assertIn(self.approver_1, outbox[1].body)
self.assertIn(self.approver_1, outbox[1].html)
self.assertIn(self.approver_2, outbox[1].body)
self.assertIn(self.approver_2, outbox[1].html)
db_emails = EmailModel.query.count()
self.assertEqual(db_emails, 2)
def test_send_ramp_up_approval_request_email(self):
with mail.record_messages() as outbox:
send_ramp_up_approval_request_email(self.sender, self.recipients, self.primary_investigator)
self.assertEqual(len(outbox), 1)
self.assertEqual(outbox[0].subject, 'Research Ramp-up Plan Approval Request')
self.assertIn(self.primary_investigator, outbox[0].body)
self.assertIn(self.primary_investigator, outbox[0].html)
db_emails = EmailModel.query.count()
self.assertEqual(db_emails, 1)
def test_send_ramp_up_approval_request_first_review_email(self):
with mail.record_messages() as outbox:
send_ramp_up_approval_request_first_review_email(
self.sender, self.recipients, self.primary_investigator
)
self.assertEqual(len(outbox), 1)
self.assertEqual(outbox[0].subject, 'Research Ramp-up Plan Approval Request')
self.assertIn(self.primary_investigator, outbox[0].body)
self.assertIn(self.primary_investigator, outbox[0].html)
db_emails = EmailModel.query.count()
self.assertEqual(db_emails, 1)
def test_send_ramp_up_approved_email(self):
with mail.record_messages() as outbox:
send_ramp_up_approved_email(self.sender, self.recipients, self.approver_1)
self.assertEqual(len(outbox), 1)
self.assertEqual(outbox[0].subject, 'Research Ramp-up Plan Approved')
self.assertIn(self.approver_1, outbox[0].body)
self.assertIn(self.approver_1, outbox[0].html)
send_ramp_up_approved_email(self.sender, self.recipients, self.approver_1, self.approver_2)
self.assertEqual(len(outbox), 2)
self.assertIn(self.approver_1, outbox[1].body)
self.assertIn(self.approver_1, outbox[1].html)
self.assertIn(self.approver_2, outbox[1].body)
self.assertIn(self.approver_2, outbox[1].html)
db_emails = EmailModel.query.count()
self.assertEqual(db_emails, 2)
def test_send_ramp_up_denied_email(self):
with mail.record_messages() as outbox:
send_ramp_up_denied_email(self.sender, self.recipients, self.approver_1)
self.assertEqual(outbox[0].subject, 'Research Ramp-up Plan Denied')
self.assertIn(self.approver_1, outbox[0].body)
self.assertIn(self.approver_1, outbox[0].html)
db_emails = EmailModel.query.count()
self.assertEqual(db_emails, 1)
def test_send_send_ramp_up_denied_email_to_approver(self):
with mail.record_messages() as outbox:
send_ramp_up_denied_email_to_approver(
self.sender, self.recipients, self.primary_investigator, self.approver_2
)
self.assertEqual(outbox[0].subject, 'Research Ramp-up Plan Denied')
self.assertIn(self.primary_investigator, outbox[0].body)
self.assertIn(self.primary_investigator, outbox[0].html)
self.assertIn(self.approver_2, outbox[0].body)
self.assertIn(self.approver_2, outbox[0].html)
db_emails = EmailModel.query.count()
self.assertEqual(db_emails, 1)