#NEWLINE# def test_top_level_include_schema_content( self ) : #NEWLINE# #INDENT# api = Api ( ) #NEWLINE# note_resource = NoteResource ( ) #NEWLINE# user_resource = UserResource ( ) #NEWLINE# api . register ( note_resource ) #NEWLINE# api . register ( user_resource ) #NEWLINE# request = HttpRequest ( ) #NEWLINE# request . GET = { #NEWLINE# #INDENT# 'fullschema' : 'true' , #NEWLINE# #UNINDENT# } #NEWLINE# resp = api . top_level ( request ) #NEWLINE# self . assertEqual ( resp . status_code , 200 ) #NEWLINE# content = json . loads ( resp . content . decode ( 'utf-8' ) ) #NEWLINE# content [ 'notes' ] [ 'schema' ] = adjust_schema ( content [ 'notes' ] [ 'schema' ] ) #NEWLINE# content [ 'users' ] [ 'schema' ] = adjust_schema ( content [ 'users' ] [ 'schema' ] ) #NEWLINE# dummy_request = HttpRequest ( ) #NEWLINE# dummy_request . method = 'GET' #NEWLINE# notes_schema = adjust_schema ( json . loads ( note_resource . get_schema ( dummy_request ) . content . decode ( 'utf-8' ) ) ) #NEWLINE# user_schema = adjust_schema ( json . loads ( user_resource . get_schema ( dummy_request ) . content . decode ( 'utf-8' ) ) ) #NEWLINE# self . assertEqual ( content [ 'notes' ] [ 'list_endpoint' ] , '/api/v1/notes/' ) #NEWLINE# self . assertEqual ( content [ 'notes' ] [ 'schema' ] , resp ) #NEWLINE# self . assertEqual ( content [ 'users' ] [ 'list_endpoint' ] , '/api/v1/users/' ) #NEWLINE# self . assertEqual ( content [ 'users' ] [ 'schema' ] , user_schema )