#NEWLINE# def test_if_the_returned_list_are_from_correct_collection( self ) : #NEWLINE# #INDENT# '\n        test if the API is considering the colletion on filter\n        ' #NEWLINE# collection1 = modelfactories . CollectionFactory ( ) #NEWLINE# collection2 = modelfactories . CollectionFactory ( ) #NEWLINE# journal = modelfactories . JournalFactory . create ( ) #NEWLINE# journal . join ( collection1 , self . user ) #NEWLINE# modelfactories . IssueFactory . create ( journal = journal ) #NEWLINE# response1 = self . app . get ( ( '/api/v2/issues/?collection=%s&print_issn=%s' % ( collection1 . name , journal . print_issn ) ) , extra_environ = self . extra_environ ) #NEWLINE# content1 = json . loads ( response1 . content ) #NEWLINE# self . assertEqual ( response1 . status_code , 200 ) #NEWLINE# self . assertTrue ( ( 'objects' in response1 . content ) ) #NEWLINE# self . assertEqual ( len ( content1 [ 'objects' ] ) , 1 ) #NEWLINE# response2 = self . app . get ( ( '/api/v2/issues/?collection=%s&print_issn=%s' % ( collection2 . name , journal . print_issn ) ) , extra_environ = self . extra_environ ) #NEWLINE# content2 = json . loads ( response2 . content ) #NEWLINE# self . assertEqual ( response2 . status_code , 200 ) #NEWLINE# self . assertTrue ( ( 'objects' in response2 . content ) ) #NEWLINE# self . assertEqual ( len ( content2 [ 'objects' ] ) , 0 )