Merge "Changed "Delete volume" success message text"
This commit is contained in:
commit
fc075fa12f
@ -34,6 +34,7 @@ LOG = logging.getLogger(__name__)
|
||||
class DeleteVolumeSnapshot(tables.DeleteAction):
|
||||
data_type_singular = _("Volume Snapshot")
|
||||
data_type_plural = _("Volume Snapshots")
|
||||
action_past = _("Scheduled deletion of")
|
||||
|
||||
def delete(self, request, obj_id):
|
||||
api.volume_snapshot_delete(request, obj_id)
|
||||
|
@ -22,6 +22,7 @@ from django import http
|
||||
from django.core.urlresolvers import reverse
|
||||
from mox import IsA
|
||||
|
||||
from openstack_dashboard import api
|
||||
from openstack_dashboard.api import cinder
|
||||
from openstack_dashboard.test import helpers as test
|
||||
|
||||
@ -59,3 +60,33 @@ class VolumeSnapshotsViewTests(test.TestCase):
|
||||
args=[volume.id])
|
||||
res = self.client.post(url, formData)
|
||||
self.assertRedirectsNoFollow(res, INDEX_URL)
|
||||
|
||||
@test.create_stubs({api: ['image_list_detailed',
|
||||
'snapshot_list_detailed',
|
||||
'volume_snapshot_list',
|
||||
'volume_snapshot_delete', ], })
|
||||
def test_delete_volume_snapshot(self):
|
||||
vol_snapshots = self.volume_snapshots.list()
|
||||
snapshot = self.volume_snapshots.first()
|
||||
|
||||
api.image_list_detailed(IsA(http.HttpRequest),
|
||||
marker=None).AndReturn(([], False))
|
||||
api.snapshot_list_detailed(IsA(http.HttpRequest),
|
||||
marker=None).AndReturn(([], False))
|
||||
api.volume_snapshot_list(IsA(http.HttpRequest)). \
|
||||
AndReturn(vol_snapshots)
|
||||
api.volume_snapshot_delete(IsA(http.HttpRequest), snapshot.id)
|
||||
api.image_list_detailed(IsA(http.HttpRequest),
|
||||
marker=None).AndReturn(([], False))
|
||||
api.snapshot_list_detailed(IsA(http.HttpRequest),
|
||||
marker=None).AndReturn(([], False))
|
||||
api.volume_snapshot_list(IsA(http.HttpRequest)). \
|
||||
AndReturn([])
|
||||
self.mox.ReplayAll()
|
||||
|
||||
formData = {'action':
|
||||
'volume_snapshots__delete__%s' % snapshot.id}
|
||||
res = self.client.post(INDEX_URL, formData, follow=True)
|
||||
|
||||
self.assertIn("Scheduled deletion of Volume Snapshot: test snapshot",
|
||||
[m.message for m in res.context['messages']])
|
||||
|
@ -37,6 +37,7 @@ DELETABLE_STATES = ("available", "error")
|
||||
class DeleteVolume(tables.DeleteAction):
|
||||
data_type_singular = _("Volume")
|
||||
data_type_plural = _("Volumes")
|
||||
action_past = _("Scheduled deletion of")
|
||||
|
||||
def delete(self, request, obj_id):
|
||||
obj = self.table.get_object_by_id(obj_id)
|
||||
|
@ -238,7 +238,8 @@ class VolumeViewTests(test.TestCase):
|
||||
|
||||
url = reverse('horizon:project:volumes:index')
|
||||
res = self.client.post(url, formData, follow=True)
|
||||
self.assertMessageCount(res, count=0)
|
||||
self.assertIn("Scheduled deletion of Volume: Volume name",
|
||||
[m.message for m in res.context['messages']])
|
||||
|
||||
@test.create_stubs({cinder: ('volume_list',
|
||||
'volume_delete',),
|
||||
|
@ -346,12 +346,12 @@ def data(TEST):
|
||||
TEST.usages.add(usage_obj)
|
||||
|
||||
volume_snapshot = vol_snaps.Snapshot(vol_snaps.SnapshotManager(None),
|
||||
{'id': 2,
|
||||
'display_name': 'test snapshot',
|
||||
'display_description': 'vol snap!',
|
||||
'size': 40,
|
||||
'status': 'available',
|
||||
'volume_id': 1})
|
||||
{'id': '40f3fabf-3613-4f5e-90e5-6c9a08333fc3',
|
||||
'display_name': 'test snapshot',
|
||||
'display_description': 'vol snap!',
|
||||
'size': 40,
|
||||
'status': 'available',
|
||||
'volume_id': '41023e92-8008-4c8b-8059-7f2293ff3775'})
|
||||
TEST.volume_snapshots.add(volume_snapshot)
|
||||
|
||||
cert_data = {'private_key': 'private',
|
||||
|
Loading…
x
Reference in New Issue
Block a user