def _test_stack_action(self, action):
        stack = self.stacks.first()

        api.heat.stacks_list(IsA(http.HttpRequest),
                             marker=None,
                             paginate=True,
                             sort_dir='desc') \
            .AndReturn([self.stacks.list(), True, True])

        getattr(api.heat, 'action_%s' % action)(IsA(http.HttpRequest),
                                                stack.id).AndReturn(stack)

        self.mox.ReplayAll()

        form_data = {"action": "stacks__%s__%s" % (action, stack.id)}
        res = self.client.post(INDEX_URL, form_data)

        self.assertNoFormErrors(res)
        self.assertRedirectsNoFollow(res, INDEX_URL)
dataset/ETHPy150Open openstack/horizon/openstack_dashboard/dashboards/project/stacks/tests.py/StackTests._test_stack_action/original