#NEWLINE# def test_hslice( self ) : #NEWLINE# #INDENT# ( alpha , beta , refs ) = self . _create_bags ( ) #NEWLINE# self . assertEqual ( RefsBag . objects . hslice ( id = alpha . id , attr = 'refs' , keys = [ '0' ] ) , { #NEWLINE# #INDENT# '0' : refs [ 0 ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( RefsBag . objects . filter ( id = alpha . id ) . hslice ( attr = 'refs' , keys = [ '0' ] ) , { #NEWLINE# #INDENT# '0' : refs [ 0 ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( RefsBag . objects . hslice ( id = alpha . id , attr = 'refs' , keys = [ 'invalid' ] ) , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } )