#NEWLINE# def test_reverse_foreign_key_retrieve_with_null( self ) : #NEWLINE# #INDENT# queryset = OneToOneTarget . objects . all ( ) #NEWLINE# serializer = NullableOneToOneTargetSerializer ( queryset , many = True ) #NEWLINE# expected = [ { #NEWLINE# #INDENT# 'id' : 1 , #NEWLINE# 'name' : 'target-1' , #NEWLINE# 'nullable_source' : None , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 2 , #NEWLINE# 'name' : 'target-2' , #NEWLINE# 'nullable_source' : 1 , #NEWLINE# #UNINDENT# } ] #NEWLINE# self . assertEqual ( serializer . data , expected )