#NEWLINE# @ raises ( MediaFile . DoesNotExist ) #NEWLINE# def test_delete_and_respond_with_admin( self ) : #NEWLINE# #INDENT# url = reverse ( 'api:project_single_media' , kwargs = { #NEWLINE# #INDENT# 'project_id' : self . project . id , #NEWLINE# 'contribution_id' : self . contribution . id , #NEWLINE# 'file_id' : self . image_file . id , #NEWLINE# #UNINDENT# } ) #NEWLINE# request = self . factory . delete ( url ) #NEWLINE# request . user = self . admin #NEWLINE# view = MediaAbstractAPIView ( ) #NEWLINE# view . request = url #NEWLINE# view . delete_and_respond ( request , self . contribution , self . image_file ) #NEWLINE# MediaFile . objects . get ( pk = self . image_file . id )