Return 400 when attempting to relaunch an ad hoc command with deleted inventory. Fixes https://trello.com/c/IbvBelXJ

This commit is contained in:
Chris Church
2015-05-11 20:32:43 -04:00
parent 9e898bf42a
commit 2d1d371582
2 changed files with 9 additions and 2 deletions
+7
View File
@@ -719,6 +719,13 @@ class AdHocCommandApiTest(BaseAdHocCommandTest):
self.patch(url, {}, expect=401)
self.delete(url, expect=401)
# Try to relaunch after the inventory has been marked inactive.
self.inventory.mark_inactive()
with self.current_user('admin'):
response = self.get(url, expect=200)
self.assertEqual(response['passwords_needed_to_start'], [])
response = self.post(url, {}, expect=400)
def test_ad_hoc_command_events_list(self):
with self.current_user('admin'):
response = self.run_test_ad_hoc_command()