Skip to content

Commit

Permalink
chore: Sandro advice - check message responde data
Browse files Browse the repository at this point in the history
  • Loading branch information
jamoqs committed Nov 2, 2023
1 parent 8e90c3d commit 2ecc5ee
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/billing/tests/test_process_transaction.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import json

import factory
from django.contrib.auth import get_user_model
from django.test import TestCase
Expand Down Expand Up @@ -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):
"""
Expand Down

0 comments on commit 2ecc5ee

Please sign in to comment.