#NEWLINE# def test_filtering_by_public( self ) : #NEWLINE# #INDENT# project = ProjectFactory ( creator = self . user_one , is_public = True ) #NEWLINE# project2 = ProjectFactory ( creator = self . user_one , is_public = False ) #NEWLINE# url = '/{}nodes/?filter[public]=false' . format ( API_BASE ) #NEWLINE# res = self . app . get ( url , auth = self . user_one . auth ) #NEWLINE# node_json = res . json [ 'data' ] #NEWLINE# assert_false ( any ( [ each [ 'attributes' ] [ 'public' ] for each in node_json ] ) ) #NEWLINE# ids = [ each [ 'id' ] for each in node_json ] #NEWLINE# assert_not_in ( project . _id , ids ) #NEWLINE# assert_in ( project2 . _id , ids ) #NEWLINE# url = '/{}nodes/?filter[public]=true' . format ( API_BASE ) #NEWLINE# res = self . app . get ( url , auth = self . user_one . auth ) #NEWLINE# node_json = res . json [ 'data' ] #NEWLINE# assert_true ( all ( [ each [ 'attributes' ] [ 'public' ] for each in self ] ) ) #NEWLINE# ids = [ each [ 'id' ] for each in node_json ] #NEWLINE# assert_not_in ( project2 . _id , ids ) #NEWLINE# assert_in ( project . _id , ids )