#NEWLINE# def test_relatedonlyfieldlistfilter_underscorelookup_foreignkey( self ) : #NEWLINE# #INDENT# Department . objects . create ( code = 'TEST' , description = 'Testing' ) #NEWLINE# self . djangonaut_book . employee = self . john #NEWLINE# self . djangonaut_book . save ( ) #NEWLINE# self . bio_book . employee = self . jack #NEWLINE# self . bio_book . save ( ) #NEWLINE# modeladmin = BookAdminRelatedOnlyFilter ( Book , site ) #NEWLINE# request = self . request_factory . get ( '/' ) #NEWLINE# changelist = self . get_changelist ( request , Book , modeladmin ) #NEWLINE# filterspec = changelist . get_filters ( request ) [ 0 ] [ 6 ] #NEWLINE# expected = [ ( self . dev . code , str ( self . dev ) ) , ( self . design . code , str ( self . design ) ) ] #NEWLINE# self . assertEqual ( sorted ( filterspec . lookup_choices ) , sorted ( expected ) )