mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-03-01 09:30:46 +00:00
2cb3fb27e2 pyl 46a590749d pulled in subtrees and resolved conflicts w/ burnettk 1dcad72629 Report URL fixes (#29) 131dbeb3cf oops c50c85edaf mypy fixes 3735b71e06 removed duplicate code ba08826c65 modify process_groups_list so it can process any group path, not just the root process_groups_list now takes an optional group path 1e09c95520 renamed and reordered some methods in base_test.py dfa79360c4 Merge branch 'main' into feature/nested-groups-2 450a8d0757 Delete groups now checks for running instances in nested models also, pyl c814e991a0 use error as a status instead of faulted w/ burnettk 3211e7a49e fixed up the process instance show page and moved contents of scss to css file and load that last w/ burnettk git-subtree-dir: spiffworkflow-backend git-subtree-split: 2cb3fb27e200e211965175914c01f7fd7290aa75
73 lines
2.4 KiB
Python
73 lines
2.4 KiB
Python
"""Test_various_bpmn_constructs."""
|
|
from flask.app import Flask
|
|
from flask.testing import FlaskClient
|
|
from tests.spiffworkflow_backend.helpers.base_test import BaseTest
|
|
|
|
from spiffworkflow_backend.models.user import UserModel
|
|
from spiffworkflow_backend.services.process_instance_processor import (
|
|
ProcessInstanceProcessor,
|
|
)
|
|
from spiffworkflow_backend.services.process_instance_service import (
|
|
ProcessInstanceService,
|
|
)
|
|
|
|
|
|
class TestDotNotation(BaseTest):
|
|
"""TestVariousBpmnConstructs."""
|
|
|
|
def test_dot_notation(
|
|
self,
|
|
app: Flask,
|
|
client: FlaskClient,
|
|
with_db_and_bpmn_file_cleanup: None,
|
|
with_super_admin_user: UserModel,
|
|
) -> None:
|
|
"""Test_form_data_conversion_to_dot_dict."""
|
|
process_group_id = "dot_notation_group"
|
|
process_model_id = "test_dot_notation"
|
|
bpmn_file_name = "diagram.bpmn"
|
|
bpmn_file_location = "dot_notation"
|
|
process_model_identifier = self.create_group_and_model_with_bpmn(
|
|
client,
|
|
with_super_admin_user,
|
|
process_group_id=process_group_id,
|
|
process_model_id=process_model_id,
|
|
bpmn_file_name=bpmn_file_name,
|
|
bpmn_file_location=bpmn_file_location,
|
|
)
|
|
|
|
headers = self.logged_in_headers(with_super_admin_user)
|
|
response = self.create_process_instance_from_process_model_id(
|
|
client, process_model_identifier, headers
|
|
)
|
|
process_instance_id = response.json["id"]
|
|
process_instance = ProcessInstanceService().get_process_instance(
|
|
process_instance_id
|
|
)
|
|
|
|
processor = ProcessInstanceProcessor(process_instance)
|
|
processor.do_engine_steps(save=True)
|
|
|
|
user_task = processor.get_ready_user_tasks()[0]
|
|
form_data = {
|
|
"invoice.contibutorName": "Elizabeth",
|
|
"invoice.contributorId": 100,
|
|
"invoice.invoiceId": 10001,
|
|
"invoice.invoiceAmount": "1000.00",
|
|
"invoice.dueDate": "09/30/2022",
|
|
}
|
|
ProcessInstanceService.complete_form_task(
|
|
processor, user_task, form_data, with_super_admin_user
|
|
)
|
|
|
|
expected = {
|
|
"contibutorName": "Elizabeth",
|
|
"contributorId": 100,
|
|
"invoiceId": 10001,
|
|
"invoiceAmount": "1000.00",
|
|
"dueDate": "09/30/2022",
|
|
}
|
|
|
|
processor.do_engine_steps(save=True)
|
|
assert processor.get_data()["invoice"] == expected
|