'A request with with no stack where report.getMessage() has newlines
in it is handled properly'

def test_long_exception_request(self):

    email = self.example_email('hamlet')
    self.login(email)
    with patch('zerver.decorator.rate_limit') as rate_limit_patch:
        rate_limit_patch.side_effect = capture_and_throw
        result = self.client_get('/json/users')
        self.assert_json_error(result, 'Internal    server    error', status_code=500)
        rate_limit_patch.assert_called_once()
        global captured_request
        global captured_exc_info
        record = self.logger.makeRecord('name', logging.ERROR, 'function', 15, 'message\nmoremesssage\nmore', {}, None)
        record.request = captured_request
        report = self.run_handler(record)
        self.assertIn('user_email', report)
        self.assertIn('message', report)
        self.assertIn('stack_trace', report)
        self.assertEqual(report['stack_trace'], 'message\nmoremesssage\nmore')
        self.assertEqual(report['message'], 'message')
