

@test.create_stubs({
    cinder: ('volume_cgroup_list_with_vol_type_names', 'volume_cgroup_delete'),
})
def test_delete_cgroup(self):
    cgroups = self.cinder_consistencygroups.list()
    cgroup = self.cinder_consistencygroups.first()
    cinder.volume_cgroup_list_with_vol_type_names(IsA(http.HttpRequest)).AndReturn(cgroups)
    cinder.volume_cgroup_delete(IsA(http.HttpRequest), cgroup.id, force=False)
    if (django.VERSION < (1, 9)):
        cinder.volume_cgroup_list_with_vol_type_names(IsA(http.HttpRequest)).AndReturn(cgroups)
    self.mox.ReplayAll()
    formData = {
        'action': ('volume_cgroups__deletecg__%s' % cgroup.id),
    }
    res = self.client.post(VOLUME_CGROUPS_TAB_URL, formData, follow=True)
    self.assertIn('Scheduled deletion of Consistency Group: cg_1', [m.message for m in res.context['messages']])

dataset/ETHPy150Open openstack/horizon/openstack_dashboard/dashboards/project/volumes/cgroups/tests.py ConsistencyGroupTests.test_delete_cgroup/original