#NEWLINE# def test_data_with_embed_deferred( self ) : #NEWLINE# #INDENT# class UserDeferredLocationSerializer ( UserLocationSerializer ) : #NEWLINE# #INDENT# class Meta ( ) : #NEWLINE# #INDENT# model = User #NEWLINE# name = 'user_deferred_location' #NEWLINE# #UNINDENT# location = DynamicRelationField ( LocationSerializer , embed = True , deferred = True ) #NEWLINE# #UNINDENT# data = UserDeferredLocationSerializer ( self . fixture . users [ 0 ] ) . data #NEWLINE# self . assertFalse ( ( 'location' in data ) ) #NEWLINE# data = UserDeferredLocationSerializer ( self . fixture . users [ 0 ] , request_fields = { #NEWLINE# #INDENT# 'id' : True , #NEWLINE# 'name' : True , #NEWLINE# 'location' : True , #NEWLINE# #UNINDENT# } ) . data #NEWLINE# self . assertTrue ( ( 'location' in data ) ) #NEWLINE# self . assertEqual ( data [ 'location' ] [ 'name' ] , '0' )