#NEWLINE# def test_document_version_revert( 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_object : #NEWLINE# #INDENT# document . new_version ( file_object = File ( document_version ) ) #NEWLINE# #UNINDENT# self . assertEqual ( document . versions . count ( ) , 2 ) #NEWLINE# document_version = document . versions . first ( ) #NEWLINE# self . client . post ( reverse ( 'rest_api:documentversion-revert' , args = ( document_version . pk , ) ) ) #NEWLINE# self . assertEqual ( document . versions . count ( ) , 1 ) #NEWLINE# self . assertEqual ( document_version , document . latest_version )