Merge "fix the Bug of test in action_executions panel"
This commit is contained in:
commit
d853a02b19
@ -13,8 +13,10 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
import mock
|
|
||||||
|
|
||||||
|
from openstack_dashboard.test import helpers
|
||||||
|
|
||||||
|
from mistraldashboard import api
|
||||||
from mistraldashboard.test import helpers as test
|
from mistraldashboard.test import helpers as test
|
||||||
|
|
||||||
INDEX_URL = reverse('horizon:mistral:action_executions:index')
|
INDEX_URL = reverse('horizon:mistral:action_executions:index')
|
||||||
@ -22,10 +24,12 @@ INDEX_URL = reverse('horizon:mistral:action_executions:index')
|
|||||||
|
|
||||||
class ActionExecutionsTest(test.TestCase):
|
class ActionExecutionsTest(test.TestCase):
|
||||||
|
|
||||||
|
@helpers.create_mocks({api: ('action_executions_list',)})
|
||||||
def test_index(self):
|
def test_index(self):
|
||||||
with mock.patch('mistraldashboard.api.action_executions_list',
|
self.mock_action_executions_list.return_value =\
|
||||||
return_value=self.
|
self.mistralclient_action_executions.list()
|
||||||
mistralclient_action_executions.list()):
|
|
||||||
res = self.client.get(INDEX_URL)
|
res = self.client.get(INDEX_URL)
|
||||||
|
|
||||||
self.assertTemplateUsed(res, 'mistral/action_executions/index.html')
|
self.assertTemplateUsed(res, 'mistral/action_executions/index.html')
|
||||||
|
self.mock_action_executions_list.assert_called_once_with(
|
||||||
|
helpers.IsHttpRequest())
|
||||||
|
Loading…
Reference in New Issue
Block a user