Skip to content

Commit 6f1b95b

Browse files
Update test_nowpayments_v2_2_0.py
1 parent 1d40307 commit 6f1b95b

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/test_nowpayments_v2_2_0.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,19 @@ def test_nowpayments_ipn_test_bypass_rejects_empty_payload(client, app_module, m
198198

199199
assert response.status_code == 400
200200
assert body['error'] == 'NOWPAYMENTS_IPN_PAYLOAD_INVALID'
201+
202+
203+
def test_nowpayments_ipn_test_bypass_invalid_payload_returns_debug_details(client, app_module, monkeypatch):
204+
monkeypatch.setenv('NOWPAYMENTS_IPN_TEST_BYPASS', '1')
205+
206+
response = client.post(
207+
'/api/payments/nowpayments/ipn?test_bypass=1',
208+
data='',
209+
headers={'Content-Type': 'application/json'},
210+
)
211+
body = response.get_json()
212+
213+
assert response.status_code == 400
214+
assert body['error'] == 'NOWPAYMENTS_IPN_PAYLOAD_INVALID'
215+
assert body['details']['debug_payload']['content_type'] == 'application/json'
216+
assert body['details']['debug_payload']['payload_keys'] == ['test_bypass']

0 commit comments

Comments
 (0)