Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
tests: Verify error logging of Internal Server Error in simulate_error.
Mohit Guptac02e011be4a6
diff --git a/zerver/tests/test_logging_handlers.py b/zerver/tests/test_logging_handlers.pyindex 9a385090954..ac3db916dcc 100644--- a/zerver/tests/test_logging_handlers.py+++ b/zerver/tests/test_logging_handlers.py@@ -71,11 +71,15 @@ class AdminNotifyHandlerTest(ZulipTestCase):def simulate_error(self) -> logging.LogRecord:self.login('hamlet')- with patch("zerver.decorator.rate_limit") as rate_limit_patch:+ with patch("zerver.decorator.rate_limit") as rate_limit_patch, \+ self.assertLogs('django.request', level='ERROR') as error_log:rate_limit_patch.side_effect = capture_and_throwresult = self.client_get("/json/users")self.assert_json_error(result, "Internal server error", status_code=500)rate_limit_patch.assert_called_once()+ self.assertEqual(error_log.output, [+ 'ERROR:django.request:Internal Server Error: /json/users'+ ])record = self.logger.makeRecord('name',