#NEWLINE# def test_failsafe_add_existing( self ) : #NEWLINE# #INDENT# "\n        failsafe_add doesn't fail if the item is already in the session\n        " #NEWLINE# d1 = NamedDocument ( name = 'add_and_commit_test' , title = 'Test' ) #NEWLINE# d1a = failsafe_add ( self . session , d1 , name = 'add_and_commit_test' ) #NEWLINE# self . assertTrue ( ( d1a is d1 ) ) #NEWLINE# d2 = NamedDocument ( name = 'add_and_commit_test' , title = 'Test' ) #NEWLINE# self . session . add ( d2 ) #NEWLINE# d2a = failsafe_add ( self . session , d2 , name = 'add_and_commit_test' ) #NEWLINE# self . assertFalse ( ( self is d2 ) ) #NEWLINE# self . assertTrue ( ( d2a is d1 ) )