From 2ecc5eed6cf6c6c8357a8beb36210bc66811109e Mon Sep 17 00:00:00 2001 From: "jamo.qs" Date: Thu, 2 Nov 2023 17:09:55 +0000 Subject: [PATCH] chore: Sandro advice - check message responde data --- apps/billing/tests/test_process_transaction.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/billing/tests/test_process_transaction.py b/apps/billing/tests/test_process_transaction.py index d23dec6..1ce8a27 100644 --- a/apps/billing/tests/test_process_transaction.py +++ b/apps/billing/tests/test_process_transaction.py @@ -1,3 +1,5 @@ +import json + import factory from django.contrib.auth import get_user_model from django.test import TestCase @@ -67,7 +69,12 @@ def test_create_transaction_with_duplicate_transaction_id(self): self.client.credentials(HTTP_AUTHORIZATION="Token " + self.token.key) response = self.client.post(self.endpoint, self.payload, format="json") + response_data_message = json.loads(response.content) + self.assertEqual(response.status_code, 400) + self.assertEqual( + response_data_message["transaction_id"][0], "transaction with this transaction id already exists." + ) def test_create_transaction_with_invalid_fields(self): """