def test_on_options(self):
"""
need to check if status of the response is set for 200 and
"""
env = create_environ(path='/')
req = Request(env)
req.context = {
'doc': {}
}
resp = Response()
resource = mongoengine.CollectionResource(objects_class=FakeObjectList, max_limit=2)
resource.on_options(req=req, resp=resp)
self.assertEqual(resp.get_header('Allow'), 'GET, HEAD, OPTIONS, POST, PUT')
self.assertEqual(resp.body, {
'name': 'FakeObjectList',
'description': 'Extend list to match interface of List resource',
})
评论列表
文章目录