def test_coreapi_schema_compatible(self):
schema_generator = SchemaGenerator(
title='Test View', patterns=urlpatterns2)
schema = schema_generator.get_schema()
expected = coreapi.Document(
url='',
title='Test View',
content={
'example-view': {
'create': coreapi.Link(
url='/example-view/',
action='post',
description=description_format(ExampleView.__doc__,
None, ),
fields=[]),
'read': coreapi.Link(
url='/example-view/',
action='get',
description=description_format(ExampleView.__doc__,
None, ),
fields=[])
}
})
self.assertEquals(schema, expected)
评论列表
文章目录