Commit 6bfc62ce authored by wenjie.zheng's avatar wenjie.zheng

erp5_workflow_test_data: check woerkflow history with expected contents dict...

erp5_workflow_test_data: check woerkflow history with expected contents dict to make sure the history contents are correct.
parent 1aaf6813
......@@ -248,12 +248,14 @@ class TestDCWorkflow(TestERP5WorkflowMixin):
checkLine({'state': 'validated'}, 2)
checkLine({'state': 'validated'}, 3)
checkLine({'state': 'invalidated'}, 4)
expected_validated_item_dict = {'comment': '', 'error_message': '', 'actor': 'ERP5TypeTestCase', 'state': 'validated', 'action': 'validate'}
expected_invalidated_item_dict = {'comment': '', 'error_message': '', 'actor': 'ERP5TypeTestCase', 'state': 'invalidated', 'action': 'invalidate'}
# check history keys are identical before and after conversion.
self.assertEqual(sorted(item_list[2].keys()),sorted(item_list[4].keys()))
# check key values are shown as expected;
expected_item_dict = {'comment': '', 'error_message': '', 'actor': 'ERP5TypeTestCase', 'state': 'invalidated', 'action': 'invalidate'}
for key in expected_item_dict:
self.assertEqual(item_list[4].getProperty(key), expected_item_dict[key])
for key in expected_invalidated_item_dict:
self.assertEqual(item_list[2].getProperty(key), expected_validated_item_dict[key])
self.assertEqual(item_list[4].getProperty(key), expected_invalidated_item_dict[key])
# check date time is generated
self.assertTrue(item_list[4].getProperty('time') is not None)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment