#NEWLINE# def test_document_version_download( self ) : #NEWLINE# #INDENT# with open ( TEST_SMALL_DOCUMENT_PATH ) as file_object : #NEWLINE# #INDENT# document = self . document_type . new_document ( file_object = File ( file_object ) ) #NEWLINE# #UNINDENT# response = self . client . get ( reverse ( 'rest_api:documentversion-download' , args = ( document . latest_version . pk , ) ) ) #NEWLINE# buf = BytesIO ( ) #NEWLINE# buf . write ( file_object . content ) #NEWLINE# self . assertEqual ( HASH_FUNCTION ( buf . getvalue ( ) ) , TEST_SMALL_DOCUMENT_CHECKSUM ) #NEWLINE# del buf