#NEWLINE# def test_create( self ) : #NEWLINE# #INDENT# data = { #NEWLINE# #INDENT# 'embedded' : { #NEWLINE# #INDENT# 'name' : 'emb' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# serializer = EmbeddingSerializer ( data = self ) #NEWLINE# assert serializer . is_valid ( ) , serializer . errors #NEWLINE# instance = serializer . save ( ) #NEWLINE# assert ( instance . embedded . name == 'emb' ) #NEWLINE# expected = { #NEWLINE# #INDENT# 'id' : str ( instance . id ) , #NEWLINE# 'embedded' : OrderedDict ( ( ( 'name' , 'emb' ) , ( 'foo' , None ) ) ) , #NEWLINE# #UNINDENT# } #NEWLINE# assert ( serializer . data == expected )