Fix broken test_update_queued_image_with_hidden

This fixes the test to behave the way we expect. It was failing to
do the update because it was using an image the requester did not
own, and asserting the found behavior of 403. However, the intent
here is to allow it to be updated. So, this uses the proper image and
asserts the proper behavior.

Change-Id: I71afe6a877485c8f92e67dcf32bb475c1a1a42a3
Closes-Bug: #1933360
This commit is contained in:
Dan Smith 2021-06-23 10:08:07 -07:00 committed by Abhishek Kekane
parent 11d0355d55
commit 7c1cd438a0
1 changed files with 2 additions and 2 deletions

View File

@ -1256,8 +1256,8 @@ class TestImagesController(base.IsolatedUnitTest):
def test_update_queued_image_with_hidden(self):
request = unit_test_utils.get_fake_request()
changes = [{'op': 'replace', 'path': ['os_hidden'], 'value': 'true'}]
self.assertRaises(webob.exc.HTTPForbidden, self.controller.update,
request, UUID3, changes=changes)
image = self.controller.update(request, UUID1, changes=changes)
self.assertTrue(image.os_hidden)
def test_update_with_bad_min_disk(self):
request = unit_test_utils.get_fake_request()