Core: add internal flag for invoice creation to use FakeWallet (#646)

* add internal flag for invoice creation to use FakeWallet
This commit is contained in:
calle
2022-07-17 14:34:25 +02:00
committed by GitHub
parent d4c30a1091
commit 6646fce549
6 changed files with 45 additions and 12 deletions

View File

@@ -25,13 +25,32 @@ async def test_create_invoice(client, inkey_headers_to):
response = await client.post(
"/api/v1/payments", json=data, headers=inkey_headers_to
)
assert response.status_code < 300
assert "payment_hash" in response.json()
assert len(response.json()["payment_hash"]) == 64
assert "payment_request" in response.json()
assert "checking_id" in response.json()
assert len(response.json()["checking_id"])
return response.json()
assert response.status_code == 201
invoice = response.json()
assert "payment_hash" in invoice
assert len(invoice["payment_hash"]) == 64
assert "payment_request" in invoice
assert "checking_id" in invoice
assert len(invoice["checking_id"])
return invoice
# check POST /api/v1/payments: invoice creation for internal payments only
@pytest.mark.asyncio
async def test_create_internal_invoice(client, inkey_headers_to):
data = await get_random_invoice_data()
data["internal"] = True
response = await client.post(
"/api/v1/payments", json=data, headers=inkey_headers_to
)
invoice = response.json()
assert response.status_code == 201
assert "payment_hash" in invoice
assert len(invoice["payment_hash"]) == 64
assert "payment_request" in invoice
assert "checking_id" in invoice
assert len(invoice["checking_id"])
return invoice
# check POST /api/v1/payments: make payment