#NEWLINE# def test_ordering( self ) : #NEWLINE# #INDENT# class EmbeddingSerializer ( EmbeddedDocumentSerializer ) : #NEWLINE# #INDENT# class Meta ( ) : #NEWLINE# #INDENT# model = OrderedEmbeddingDoc #NEWLINE# #UNINDENT# #UNINDENT# data = { #NEWLINE# #INDENT# 'embedded' : { #NEWLINE# #INDENT# 'f0' : 0 , #NEWLINE# 'f1' : 1 , #NEWLINE# 'f2' : 2 , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# serializer = EmbeddingSerializer ( data = data ) #NEWLINE# assert serializer . is_valid ( ) , serializer . errors #NEWLINE# expected = { #NEWLINE# #INDENT# 'embedded' : OrderedDict ( ( ( 'f2' , 2 ) , ( 'f0' , 0 ) , ( 'f1' , 1 ) ) ) , #NEWLINE# #UNINDENT# } #NEWLINE# assert ( serializer . data == expected )