2020-06-17 00:42:36 +00:00
|
|
|
from tests.base_test import BaseTest
|
|
|
|
|
|
|
|
from crc.services.file_service import FileService
|
|
|
|
from crc.scripts.email import Email
|
|
|
|
from crc.services.workflow_processor import WorkflowProcessor
|
|
|
|
from crc.api.common import ApiError
|
|
|
|
|
|
|
|
from crc import db
|
|
|
|
|
|
|
|
|
|
|
|
class TestEmailScript(BaseTest):
|
|
|
|
|
|
|
|
def test_do_task(self):
|
2020-06-18 03:11:47 +00:00
|
|
|
# self.load_example_data()
|
|
|
|
# self.create_reference_document()
|
2020-06-17 00:42:36 +00:00
|
|
|
workflow = self.create_workflow('email')
|
2020-06-18 03:11:47 +00:00
|
|
|
|
|
|
|
# processor = WorkflowProcessor(workflow)
|
|
|
|
# task = processor.next_task()
|
2020-06-17 23:00:16 +00:00
|
|
|
# TODO: Replace with proper `complete_form` method from test_tasks
|
2020-06-18 03:11:47 +00:00
|
|
|
# processor.complete_task(task)
|
|
|
|
# task = processor.next_task()
|
|
|
|
task_data = {
|
2020-06-17 00:42:36 +00:00
|
|
|
'PIComputingID': 'dhf8r',
|
2020-06-18 03:11:47 +00:00
|
|
|
'ApprvlApprvr1': 'lb3dp'
|
2020-06-17 00:42:36 +00:00
|
|
|
}
|
2020-06-18 03:11:47 +00:00
|
|
|
task = self.get_workflow_api(workflow).next_task
|
|
|
|
|
|
|
|
self.complete_form(workflow, task, task_data)
|
|
|
|
|
2020-06-17 00:42:36 +00:00
|
|
|
|
2020-06-18 03:11:47 +00:00
|
|
|
# script = Email()
|
|
|
|
# script.do_task(task, 'Subject', 'PIComputingID', 'ApprvlApprvr1')
|
2020-06-17 23:00:16 +00:00
|
|
|
|
|
|
|
# TODO: Add proper assertions
|
2020-06-17 00:42:36 +00:00
|
|
|
self.assertTrue(True)
|