Fix incorrect status code on Pool update

Change the pool update status code from a 200, the correct
202 Accepted.

Change-Id: I3de2b55c6fe52c6d65738f2699ffb2ae29212c29
Closes-Bug: 1464763
This commit is contained in:
Kiall Mac Innes 2015-06-22 14:45:55 +01:00
parent 53a7300103
commit cc1cc99f49
3 changed files with 8 additions and 8 deletions

View File

@ -103,7 +103,7 @@ class PoolsController(rest.RestController):
pool = self.central_api.update_pool(context, pool)
response.status_int = 200
response.status_int = 202
return DesignateAdapter.render('API_v2', pool, request=request)

View File

@ -176,10 +176,10 @@ class ApiV2PoolsTest(ApiV2TestCase):
body = {'description': 'Tester'}
url = '/pools/%s' % pool['id']
response = self.client.patch_json(url, body, status=200)
response = self.client.patch_json(url, body, status=202)
# Check the headers are what we expect
self.assertEqual(200, response.status_int)
self.assertEqual(202, response.status_int)
self.assertEqual('application/json', response.content_type)
# Check the body structure is what we expect
@ -217,10 +217,10 @@ class ApiV2PoolsTest(ApiV2TestCase):
]}
url = '/pools/%s' % pool['id']
response = self.client.patch_json(url, body, status=200)
response = self.client.patch_json(url, body, status=202)
# Check the headers are what we expect
self.assertEqual(200, response.status_int)
self.assertEqual(202, response.status_int)
self.assertEqual('application/json', response.content_type)
# Check the body structure is what we expect
@ -241,10 +241,10 @@ class ApiV2PoolsTest(ApiV2TestCase):
body = {"attributes": {"scope": "private"}}
url = '/pools/%s' % pool['id']
response = self.client.patch_json(url, body, status=200)
response = self.client.patch_json(url, body, status=202)
# Check the headers are what we expect
self.assertEqual(200, response.status_int)
self.assertEqual(202, response.status_int)
self.assertEqual('application/json', response.content_type)
# Check the values returned are what we expect

View File

@ -45,7 +45,7 @@ class PoolTest(DesignateV2Test):
patch_model = datagen.random_pool_data()
resp, new_model = PoolClient.as_user('admin').patch_pool(
old_model.id, patch_model)
self.assertEqual(resp.status, 200)
self.assertEqual(resp.status, 202)
resp, model = PoolClient.as_user('admin').get_pool(new_model.id)
self.assertEqual(resp.status, 200)