#NEWLINE# def test_exclude_entities( self ) : #NEWLINE# #INDENT# "\n        Excluded entities shouldn't returned by get_entities.\n        " #NEWLINE# response = self . client . post ( '/get-entities/' , { #NEWLINE# #INDENT# 'project' : self . resource . project . slug , #NEWLINE# 'locale' : self . locale . code , #NEWLINE# 'paths[]' : [ self . resource . path ] , #NEWLINE# 'excludeEntities[]' : [ self . entities [ 1 ] . pk ] , #NEWLINE# 'limit' : 1 , #NEWLINE# #UNINDENT# } , HTTP_X_REQUESTED_WITH = 'XMLHttpRequest' ) #NEWLINE# assert_code ( response , 200 ) #NEWLINE# assert_equal ( response . json ( ) [ 'has_next' ] , True ) #NEWLINE# assert_equal ( [ e [ 'pk' ] for e in response . json ( ) [ 'entities' ] ] , [ self . entities [ 0 ] . pk ] ) #NEWLINE# response = self . client . post ( '/get-entities/' , { #NEWLINE# #INDENT# 'project' : self . resource . project . slug , #NEWLINE# 'locale' : self . locale . code , #NEWLINE# 'paths[]' : [ self . resource . path ] , #NEWLINE# 'excludeEntities[]' : [ self . entities [ 0 ] . pk , self . entities [ 1 ] . pk ] , #NEWLINE# 'limit' : 1 , #NEWLINE# #UNINDENT# } , HTTP_X_REQUESTED_WITH = 'XMLHttpRequest' ) #NEWLINE# assert_code ( response , 200 ) #NEWLINE# assert_equal ( response . json ( ) [ 'has_next' ] , False ) #NEWLINE# assert_equal ( [ e [ 'pk' ] for e in response . json ( ) [ 'entities' ] ] , [ self . entities [ 2 ] . pk ] )