#NEWLINE# def test_get_metadata_with_file_attachment( self ) : #NEWLINE# #INDENT# for data_type in [ 'supporting_doc' , 'media' , 'source' ] : #NEWLINE# #INDENT# self . _add_form_metadata ( self . xform , ext , self . data_value , self . path ) #NEWLINE# request = self . factory . get ( '/' , ** self . extra ) #NEWLINE# response = self . view ( request , pk = self . metadata . pk ) #NEWLINE# self . assertEqual ( response . status_code , 200 ) #NEWLINE# self . assertEqual ( response . data , self . metadata_data ) #NEWLINE# ext = self . data_value [ ( self . data_value . rindex ( '.' ) + 1 ) : ] #NEWLINE# request = self . factory . get ( '/' , ** self . extra ) #NEWLINE# response = self . view ( request , pk = self . metadata . pk , format = ext ) #NEWLINE# self . assertEqual ( response . status_code , 200 ) #NEWLINE# self . assertEqual ( response [ 'Content-Type' ] , 'image/png' )