#NEWLINE# def test_before_after_configured_warn_on_non_mapper( self ) : #NEWLINE# #INDENT# ( User , users ) = ( self . classes . User , self . tables . users ) #NEWLINE# m1 = Mock ( ) #NEWLINE# mapper ( User , users ) #NEWLINE# assert_raises_message ( sa . exc . SAWarning , "before_configured' and 'after_configured' ORM events only invoke with the mapper\\(\\) function or Mapper class as the target." , event . listen , User , 'before_configured' , m1 ) #NEWLINE# assert_raises_message ( sa . exc . SAWarning , "before_configured' and 'after_configured' ORM events only invoke with the mapper\\(\\) function or Mapper class as the target." , event . listen , self , 'after_configured' , m1 )