fix tests
This commit is contained in:
parent
a8357c73f4
commit
1b3bf52be3
|
@ -178,7 +178,12 @@ class CustomBpmnScriptEngine(PythonScriptEngine): # type: ignore
|
||||||
)
|
)
|
||||||
return Script.generate_augmented_list(script_attributes_context)
|
return Script.generate_augmented_list(script_attributes_context)
|
||||||
|
|
||||||
def evaluate(self, task: SpiffTask, expression: str, external_methods=None) -> Any:
|
def evaluate(
|
||||||
|
self,
|
||||||
|
task: SpiffTask,
|
||||||
|
expression: str,
|
||||||
|
external_methods: Optional[dict[str, Any]] = None,
|
||||||
|
) -> Any:
|
||||||
"""Evaluate."""
|
"""Evaluate."""
|
||||||
return self._evaluate(expression, task.data, task, external_methods)
|
return self._evaluate(expression, task.data, task, external_methods)
|
||||||
|
|
||||||
|
|
|
@ -1732,14 +1732,14 @@ class TestProcessApi(BaseTest):
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessInstanceReportModel.create_with_attributes(
|
report = ProcessInstanceReportModel.create_with_attributes(
|
||||||
identifier="sure",
|
identifier="sure",
|
||||||
report_metadata=report_metadata,
|
report_metadata=report_metadata,
|
||||||
user=with_super_admin_user,
|
user=with_super_admin_user,
|
||||||
)
|
)
|
||||||
|
|
||||||
response = client.get(
|
response = client.get(
|
||||||
"/v1.0/process-instances/reports/sure",
|
f"/v1.0/process-instances/reports/{report.id}",
|
||||||
headers=self.logged_in_headers(with_super_admin_user),
|
headers=self.logged_in_headers(with_super_admin_user),
|
||||||
)
|
)
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
|
@ -1778,14 +1778,14 @@ class TestProcessApi(BaseTest):
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessInstanceReportModel.create_with_attributes(
|
report = ProcessInstanceReportModel.create_with_attributes(
|
||||||
identifier="sure",
|
identifier="sure",
|
||||||
report_metadata=report_metadata,
|
report_metadata=report_metadata,
|
||||||
user=with_super_admin_user,
|
user=with_super_admin_user,
|
||||||
)
|
)
|
||||||
|
|
||||||
response = client.get(
|
response = client.get(
|
||||||
"/v1.0/process-instances/reports/sure?grade_level=1",
|
f"/v1.0/process-instances/reports/{report.id}?grade_level=1",
|
||||||
headers=self.logged_in_headers(with_super_admin_user),
|
headers=self.logged_in_headers(with_super_admin_user),
|
||||||
)
|
)
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
|
@ -1800,13 +1800,13 @@ class TestProcessApi(BaseTest):
|
||||||
with_super_admin_user: UserModel,
|
with_super_admin_user: UserModel,
|
||||||
setup_process_instances_for_reports: list[ProcessInstanceModel],
|
setup_process_instances_for_reports: list[ProcessInstanceModel],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test_process_instance_report_show_with_default_list."""
|
|
||||||
response = client.get(
|
response = client.get(
|
||||||
"/v1.0/process-instances/reports/sure?grade_level=1",
|
"/v1.0/process-instances/reports/13000000?grade_level=1",
|
||||||
headers=self.logged_in_headers(with_super_admin_user),
|
headers=self.logged_in_headers(with_super_admin_user),
|
||||||
)
|
)
|
||||||
assert response.status_code == 404
|
assert response.status_code == 404
|
||||||
data = json.loads(response.get_data(as_text=True))
|
data = json.loads(response.get_data(as_text=True))
|
||||||
|
print(f"data: {data}")
|
||||||
assert data["error_code"] == "unknown_process_instance_report"
|
assert data["error_code"] == "unknown_process_instance_report"
|
||||||
|
|
||||||
def setup_testing_instance(
|
def setup_testing_instance(
|
||||||
|
@ -2643,15 +2643,16 @@ class TestProcessApi(BaseTest):
|
||||||
assert response.json is not None
|
assert response.json is not None
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
assert response.json == [
|
assert response.json == [
|
||||||
{"Header": "id", "accessor": "id"},
|
{"Header": "Id", "accessor": "id", "filterable": False},
|
||||||
{
|
{
|
||||||
"Header": "process_model_display_name",
|
"Header": "Process",
|
||||||
"accessor": "process_model_display_name",
|
"accessor": "process_model_display_name",
|
||||||
|
"filterable": False,
|
||||||
},
|
},
|
||||||
{"Header": "start_in_seconds", "accessor": "start_in_seconds"},
|
{"Header": "Start", "accessor": "start_in_seconds", "filterable": False},
|
||||||
{"Header": "end_in_seconds", "accessor": "end_in_seconds"},
|
{"Header": "End", "accessor": "end_in_seconds", "filterable": False},
|
||||||
{"Header": "username", "accessor": "username"},
|
{"Header": "Username", "accessor": "username", "filterable": False},
|
||||||
{"Header": "status", "accessor": "status"},
|
{"Header": "Status", "accessor": "status", "filterable": False},
|
||||||
{"Header": "key1", "accessor": "key1"},
|
{"Header": "key1", "accessor": "key1", "filterable": True},
|
||||||
{"Header": "key2", "accessor": "key2"},
|
{"Header": "key2", "accessor": "key2", "filterable": True},
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue