'Catch any exception and log it.'

def test_log_exception(self):

    mock_logger = Mock()
    @log_exceptions(mock_logger)
    def raise_exception():
        '\n                                                Raise    an    exception.\n                                                '
        raise Exception(u'Bad    exception.')
    self.assertRaises(Exception, raise_exception)
    self.assertTrue(mock_logger.exception.called)
