mirror of
https://github.com/sartography/cr-connect-workflow.git
synced 2025-02-22 20:58:28 +00:00
Included template test from hell
This commit is contained in:
parent
416adcbe69
commit
238840822d
@ -29,6 +29,25 @@ class TestJinjaService(BaseTest):
|
||||
docs = WorkflowService._process_documentation(task)
|
||||
self.assertEqual("Hi Dan, This is a jinja template too! Cool Right?", docs)
|
||||
|
||||
def test_jinja_service_included_includes(self):
|
||||
workflow = self.create_workflow('random_fact')
|
||||
processor = WorkflowProcessor(workflow)
|
||||
processor.do_engine_steps()
|
||||
|
||||
task = processor.next_task()
|
||||
data = {"my_template": "Hi {% include 'my_name_template' %} from {% include 'my_org_template' %},\n{% include 'my_content_template' %}",
|
||||
"my_name_template": "{{name}}",
|
||||
"my_org_template": "{{org}}",
|
||||
"my_content_template": "This is an included {% include 'my_jinja_template' %} template too!",
|
||||
"my_jinja_template": "Jinja",
|
||||
"name": "Dan",
|
||||
"org": "Bucky's"}
|
||||
task.data = data
|
||||
task.task_spec.documentation = """This is an included template:\n {% include 'my_template' %} \nCool Right?"""
|
||||
docs = WorkflowService._process_documentation(task)
|
||||
|
||||
self.assertEqual('This is an included template:\n Hi Dan from Bucky\'s,\nThis is an included Jinja template too! \nCool Right?', docs)
|
||||
|
||||
def test_jinja_service_email(self):
|
||||
workflow = self.create_workflow('jinja_email')
|
||||
workflow_api = self.get_workflow_api(workflow)
|
||||
|
Loading…
x
Reference in New Issue
Block a user