Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
test_decorators: Fix request.POST mutation typing.
Anders Kaseorgc734574e2c17
diff --git a/zerver/tests/test_decorators.py b/zerver/tests/test_decorators.pyindex 41148eef8e3..2aa6c2c2b3d 100644--- a/zerver/tests/test_decorators.py+++ b/zerver/tests/test_decorators.py@@ -11,6 +11,7 @@ import orjsonfrom django.conf import settingsfrom django.contrib.auth.models import AnonymousUserfrom django.http import HttpRequest, HttpResponse+from django.test import RequestFactoryfrom django.utils.timezone import now as timezone_nowfrom typing_extensions import override@@ -118,8 +119,7 @@ class DecoratorTestCase(ZulipTestCase):self.assertEqual(parse_client(get_req_with_client), ("test_client_2", None))def test_unparsable_user_agent(self) -> None:- request = HttpRequest()- request.POST["param"] = "test"+ request = RequestFactory().post("/", {"param": "test"})request.META["HTTP_USER_AGENT"] = "mocked should fail"with (mock.patch("zerver.middleware.parse_client", side_effect=JsonableError("message")) as m,