Merge "Fix incorrect status code on Pool update"

This commit is contained in:
Jenkins 2015-06-24 10:40:31 +00:00 committed by Gerrit Code Review
commit e6e6fe9128
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)