From 7cdd9d25854d67578c47bb085eccd5f2a652292b Mon Sep 17 00:00:00 2001 From: Martin Obersteiner Date: Tue, 10 Sep 2024 13:05:35 +0200 Subject: [PATCH] tests: fix incorrect usage of `MagicMock` `MagicMock.called_with` never did anything method is actually named `assert_called_with` --- tests/test_views_multipart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_views_multipart.py b/tests/test_views_multipart.py index 3b4774ee..0b57ca6c 100644 --- a/tests/test_views_multipart.py +++ b/tests/test_views_multipart.py @@ -484,7 +484,7 @@ def _mock_celery_result(): if res.status_code == 200: data = get_json(res) assert data["completed"] is True - assert task.called_with(str(multipart.upload_id)) + assert task.delay.call_args.args == (str(multipart.upload_id),) # Two whitespaces expected to have been sent to client before # JSON was sent. assert res.data.startswith(b" {")