#NEWLINE# def test_response_data( self ) : #NEWLINE# #INDENT# 'Test that the serialized response contains only relevant data.' #NEWLINE# body = { #NEWLINE# #INDENT# 'id' : 'test' , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . client . post ( '/v1/apps' , json . dumps ( body ) , content_type = 'application/json' , HTTP_AUTHORIZATION = 'token {}' . format ( self . token ) ) #NEWLINE# for key in response . data : #NEWLINE# #INDENT# self . assertIn ( key , [ 'uuid' , 'created' , 'updated' , 'id' , 'owner' , 'url' , 'structure' ] ) #NEWLINE# #UNINDENT# expected = { #NEWLINE# #INDENT# 'id' : 'test' , #NEWLINE# 'owner' : body . user . username , #NEWLINE# 'url' : 'test.deisapp.local' , #NEWLINE# 'structure' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertDictContainsSubset ( expected , response . data )