#NEWLINE# def test_document_new_version_upload( 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# time . sleep ( 1 ) #NEWLINE# with open ( TEST_DOCUMENT_PATH ) as file_descriptor : #NEWLINE# #INDENT# response = self . client . post ( reverse ( 'rest_api:document-version-list' , args = ( file_object . pk , ) ) , { #NEWLINE# #INDENT# 'comment' : '' , #NEWLINE# 'file' : file_descriptor , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# self . assertEqual ( response . status_code , status . HTTP_202_ACCEPTED ) #NEWLINE# self . assertEqual ( document . versions . count ( ) , 2 ) #NEWLINE# self . assertEqual ( document . exists ( ) , True ) #NEWLINE# self . assertEqual ( document . size , 272213 ) #NEWLINE# self . assertEqual ( document . file_mimetype , 'application/pdf' ) #NEWLINE# self . assertEqual ( document . file_mime_encoding , 'binary' ) #NEWLINE# self . assertEqual ( document . checksum , 'c637ffab6b8bb026ed3784afdb07663fddc60099853fae2be93890852a69ecf3' ) #NEWLINE# self . assertEqual ( document . page_count , 47 )