#NEWLINE# def test_has_timestamps( self ) : #NEWLINE# #INDENT# c = self . make_container ( ) #NEWLINE# d = ScopedIdNamedDocument ( title = 'Hello' , content = 'World' , container = c ) #NEWLINE# self . session . add ( d ) #NEWLINE# self . session . commit ( ) #NEWLINE# sleep ( 1 ) #NEWLINE# self . assertTrue ( ( d . created_at is not None ) ) #NEWLINE# self . assertTrue ( ( d . updated_at is not None ) ) #NEWLINE# updated_at = d . updated_at #NEWLINE# self . assertTrue ( ( ( d . updated_at - d . created_at ) < timedelta ( seconds = 1 ) ) ) #NEWLINE# self . assertTrue ( isinstance ( d . created_at , datetime ) ) #NEWLINE# self . assertTrue ( isinstance ( d . updated_at , datetime ) ) #NEWLINE# d . title = 'Updated hello' #NEWLINE# self . session . commit ( ) #NEWLINE# self . assertTrue ( ( self . updated_at > updated_at ) )