#NEWLINE# def test_get_list_and_respond( self ) : #NEWLINE# #INDENT# ImageFileFactory . create_batch ( 5 , ** { #NEWLINE# #INDENT# 'contribution' : self . contribution , #NEWLINE# #UNINDENT# } ) #NEWLINE# url = reverse ( 'api:project_media' , kwargs = { #NEWLINE# #INDENT# 'project_id' : self . project . id , #NEWLINE# 'contribution_id' : self . contribution . id , #NEWLINE# #UNINDENT# } ) #NEWLINE# request = self . factory . get ( url ) #NEWLINE# request . user = self . admin #NEWLINE# view = MediaAbstractAPIView ( ) #NEWLINE# view . request = request #NEWLINE# response = self . render ( view . get_list_and_respond ( request , self . contribution ) ) #NEWLINE# self . assertEqual ( len ( json . loads ( response . content ) ) , 5 )