From 3e8c629b8badf6b03720a66d9a3b70dde3448ab6 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Wed, 8 Apr 2026 15:55:58 +0200 Subject: [PATCH] tests/contrib/django: use proper mock The read mock should take at least an argument. Fixes: tests.contrib.django.fixtures.TempStoreClient:client.py:151 Can't capture request body: test_post_read_error_logging..read() takes 0 positional arguments but 1 was given Assisted-by: Cursor --- tests/contrib/django/django_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/contrib/django/django_tests.py b/tests/contrib/django/django_tests.py index 48649f8cc..b9d16772a 100644 --- a/tests/contrib/django/django_tests.py +++ b/tests/contrib/django/django_tests.py @@ -572,7 +572,7 @@ def test_post_raw_data(django_elasticapm_client): def test_post_read_error_logging(django_elasticapm_client, caplog, rf): request = rf.post("/test", data="{}", content_type="application/json") - def read(): + def read(*args, **kwargs): raise IOError("foobar") request.read = read