mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-02 08:56:07 +00:00
fix(instances): a paused VM can be destroyed from its page
The Destroy button was disabled and the confirmation page refused a
paused VM ("Instance is suspended, cannot destroy!"), while the destroy
request itself stops a paused VM like a running one. Both now offer it.
This commit is contained in:
parent
55eb63a09f
commit
be00b1cf8e
4 changed files with 30 additions and 29 deletions
|
|
@ -65,3 +65,9 @@ class DestroyOrderTestCase(TestCase):
|
|||
response = self.client.get(reverse("instances:destroy", args=[self.instance.id]))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(calls, [])
|
||||
|
||||
def test_the_confirmation_page_of_a_paused_vm_offers_the_form(self):
|
||||
with patch("instances.models.wvmInstance") as wvm:
|
||||
wvm.return_value.get_status.return_value = 3 # paused
|
||||
response = self.client.get(reverse("instances:destroy", args=[self.instance.id]))
|
||||
self.assertIn('id="delete_form"', response.content.decode())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue