Set 'Content-Location' on get-messages correctly.
Change-Id: I9e064d5cdcafdaeb8b9bb92b7b2fa4e557d83aca
This commit is contained in:
@@ -71,6 +71,8 @@ class TestMessages(util.TestBase):
|
|||||||
|
|
||||||
body = self.app(env, self.srmock)
|
body = self.app(env, self.srmock)
|
||||||
self.assertEquals(self.srmock.status, falcon.HTTP_200)
|
self.assertEquals(self.srmock.status, falcon.HTTP_200)
|
||||||
|
self.assertEquals(self.srmock.headers_dict['Content-Location'],
|
||||||
|
env['PATH_INFO'])
|
||||||
|
|
||||||
msg = json.loads(body[0])
|
msg = json.loads(body[0])
|
||||||
self.assertEquals(msg['body'], lookup[msg['ttl']])
|
self.assertEquals(msg['body'], lookup[msg['ttl']])
|
||||||
@@ -132,6 +134,8 @@ class TestMessages(util.TestBase):
|
|||||||
headers=self.headers)
|
headers=self.headers)
|
||||||
|
|
||||||
body = self.app(env, self.srmock)
|
body = self.app(env, self.srmock)
|
||||||
|
self.assertEquals(self.srmock.headers_dict['Content-Location'],
|
||||||
|
env['PATH_INFO'] + '?' + env['QUERY_STRING'])
|
||||||
|
|
||||||
cnt = 0
|
cnt = 0
|
||||||
while self.srmock.status == falcon.HTTP_200:
|
while self.srmock.status == falcon.HTTP_200:
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ class CollectionResource(object):
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
resp.location = req.path + '?' + req.query_string
|
resp.content_location = req.path + '?' + req.query_string
|
||||||
resp.body = json.dumps(resp_dict, ensure_ascii=False)
|
resp.body = json.dumps(resp_dict, ensure_ascii=False)
|
||||||
resp.status = falcon.HTTP_200
|
resp.status = falcon.HTTP_200
|
||||||
else:
|
else:
|
||||||
@@ -121,7 +121,7 @@ class ItemResource(object):
|
|||||||
message_id=message_id,
|
message_id=message_id,
|
||||||
tenant=tenant_id)
|
tenant=tenant_id)
|
||||||
|
|
||||||
resp.location = req.path + '/' + msg['id']
|
resp.content_location = req.path
|
||||||
resp.body = json.dumps(msg, ensure_ascii=False)
|
resp.body = json.dumps(msg, ensure_ascii=False)
|
||||||
resp.status = falcon.HTTP_200
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user