#NEWLINE# def test_triggertype_crud( self ) : #NEWLINE# #INDENT# saved = ReactorModelTest . _create_save_triggertype ( ) #NEWLINE# retrieved = TriggerType . get_by_id ( saved . id ) #NEWLINE# self . assertEqual ( saved . name , self . name , 'Same triggertype was not returned.' ) #NEWLINE# self . assertEqual ( retrieved . description , '' ) #NEWLINE# retrieved . description = DUMMY_DESCRIPTION #NEWLINE# saved = TriggerType . add_or_update ( retrieved ) #NEWLINE# retrieved = TriggerType . get_by_id ( saved . id ) #NEWLINE# self . assertEqual ( retrieved . description , DUMMY_DESCRIPTION , 'Update to trigger failed.' ) #NEWLINE# ReactorModelTest . _delete ( [ retrieved ] ) #NEWLINE# try : #NEWLINE# #INDENT# retrieved = TriggerType . get_by_id ( saved . id ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# retrieved = None #NEWLINE# #UNINDENT# self . assertIsNone ( retrieved , 'managed to retrieve after failure.' )