#NEWLINE# def test_marshal_nested_dict( self ) : #NEWLINE# #INDENT# model = OrderedDict ( [ ( 'foo' , fields . Raw ) , ( 'bar' , OrderedDict ( [ ( 'a' , fields . Raw ) , ( 'b' , fields . Raw ) ] ) ) ] ) #NEWLINE# marshal_fields = OrderedDict ( [ ( 'foo' , 'foo-val' ) , ( 'bar' , 'bar-val' ) , ( 'bat' , 'bat-val' ) , ( 'a' , 1 ) , ( 'b' , 2 ) , ( 'c' , 3 ) ] ) #NEWLINE# output = marshal ( marshal_fields , model ) #NEWLINE# expected = OrderedDict ( [ ( 'foo' , 'foo-val' ) , ( 'bar' , OrderedDict ( [ ( 'a' , 1 ) , ( 'b' , 2 ) ] ) ) ] ) #NEWLINE# self . assertEquals ( output , self )