diff --git a/mistraldashboard/action_executions/tests.py b/mistraldashboard/action_executions/tests.py index 0813d79..58fc6a6 100644 --- a/mistraldashboard/action_executions/tests.py +++ b/mistraldashboard/action_executions/tests.py @@ -34,6 +34,23 @@ class ActionExecutionsTest(test.TestCase): self.mock_action_executions_list.assert_called_once_with( helpers.IsHttpRequest()) + @helpers.create_mocks({api: ('action_execution_update',)}) + def test_update_post(self): + action_execution = self.mistralclient_action_executions.first() + self.mock_action_execution_update.return_value = action_execution + form_data = {"action_execution_id": action_execution.id, + "state": action_execution.state, + "output_source": "raw", + "output_data": action_execution.output} + res = self.client.post( + reverse('horizon:mistral:action_executions:update', + args=(action_execution.id,)), + form_data) + self.assertNoFormErrors(res) + self.mock_action_execution_update.assert_called_once_with( + helpers.IsHttpRequest(), action_execution.id, + action_execution.state, action_execution.output) + @helpers.create_mocks({api: ('action_execution_get',)}) def test_detail(self): action_execution = self.mistralclient_action_executions.list()[0] diff --git a/mistraldashboard/test/test_data/mistral_data.py b/mistraldashboard/test/test_data/mistral_data.py index 35cb86f..183ec3f 100644 --- a/mistraldashboard/test/test_data/mistral_data.py +++ b/mistraldashboard/test/test_data/mistral_data.py @@ -146,7 +146,7 @@ def data(TEST): 'created_at': '1', 'updated_at': '1', 'accepted': True, - 'state': 'RUNNING' + 'state': 'SUCCESS' } ) TEST.mistralclient_action_executions.add(action_executions_1)