Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

test_decorators: Call process_request as an instance method.

Zixuan James Lic86b3fd793a1
diff --git a/zerver/tests/test_decorators.py b/zerver/tests/test_decorators.py
index c761c2f80e2..3e01da933df 100644
--- a/zerver/tests/test_decorators.py
+++ b/zerver/tests/test_decorators.py
@@ -155,7 +155,7 @@ class DecoratorTestCase(ZulipTestCase):
with mock.patch(
"zerver.middleware.parse_client", side_effect=JsonableError("message")
) as m, self.assertLogs(level="ERROR"):
- LogRequests.process_request(self, request)
+ LogRequests(lambda request: HttpResponse()).process_request(request)
request_notes = RequestNotes.get_notes(request)
self.assertEqual(request_notes.client_name, "Unparsable")
m.assert_called_once()