From f9af31108f8882a8c74bb4218c31feb44d69b617 Mon Sep 17 00:00:00 2001 From: Hlamalani Date: Thu, 5 Sep 2024 09:11:05 +0200 Subject: [PATCH] fix urgency detect payload --- aaq/tests/test_utils.py | 4 +++- aaq/utils.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/aaq/tests/test_utils.py b/aaq/tests/test_utils.py index 6388a6ea..426ee7f9 100644 --- a/aaq/tests/test_utils.py +++ b/aaq/tests/test_utils.py @@ -94,7 +94,9 @@ def test_urgency_check(self): self.assertIn("details", response) self.assertIn("is_urgent", response) self.assertIn("matched_rules", response) - self.assertEqual(json.loads(request.request.body), message_text) + self.assertEqual( + json.loads(request.request.body), {"message_text": message_text} + ) self.assertIn("Bearer", request.request.headers["Authorization"]) assert response == { diff --git a/aaq/utils.py b/aaq/utils.py index d778d52d..9739c62f 100644 --- a/aaq/utils.py +++ b/aaq/utils.py @@ -13,7 +13,9 @@ def check_urgency_v2(message_text): "Content-Type": "application/json", } - response = requests.request("POST", url, json=message_text, headers=headers) + response = requests.request( + "POST", url, json={"message_text": message_text}, headers=headers + ) response.raise_for_status() return response.json()