#NEWLINE# def test_entity_filters( self ) : #NEWLINE# #INDENT# '\n        Tests if right filter calls right method in the Entity manager.\n        ' #NEWLINE# filters = ( 'missing' , 'fuzzy' , 'suggested' , 'translated' , 'untranslated' , 'has-suggestions' , 'unchanged' ) #NEWLINE# for filter_ in filters : #NEWLINE# #INDENT# filter_name = filter_ . replace ( '-' , '_' ) #NEWLINE# with patch ( 'pontoon.base.models.Entity.objects.{}' . format ( filter_name ) , return_value = Entity . objects . all ( ) ) as filter_mock : #NEWLINE# #INDENT# self . client . post ( '/get-entities/' , { #NEWLINE# #INDENT# 'project' : self . resource . project . slug , #NEWLINE# 'locale' : self . locale . code , #NEWLINE# 'paths[]' : [ self . resource . path ] , #NEWLINE# 'filter' : filter_ , #NEWLINE# 'limit' : 1 , #NEWLINE# #UNINDENT# } , HTTP_X_REQUESTED_WITH = 'XMLHttpRequest' ) #NEWLINE# assert_true ( filter_mock . called ) #NEWLINE# assert_equal ( filter_mock . call_args , call ( self . locale ) )