TEST: add hold invoices to test helpers and a basic test (#1838)

* add hold invoices and basic test

* run request in parallel

* create_task

* dont cancel it

---------

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
This commit is contained in:
dni ⚡ 2023-07-26 14:18:14 +02:00 committed by GitHub
parent dda6c1b3c1
commit 7f0c7138af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 60 additions and 2 deletions

View file

@ -11,7 +11,12 @@ from lnbits.core.crud import create_account, create_wallet
from lnbits.core.views.api import CreateInvoiceData, api_payments_create_invoice
from lnbits.db import Database
from lnbits.settings import settings
from tests.helpers import credit_wallet, get_random_invoice_data, get_real_invoice
from tests.helpers import (
credit_wallet,
get_hold_invoice,
get_random_invoice_data,
get_real_invoice,
)
@pytest_asyncio.fixture(scope="session")
@ -149,3 +154,10 @@ async def real_invoice():
invoice = get_real_invoice(100)
yield {"bolt11": invoice["payment_request"]}
del invoice
@pytest_asyncio.fixture(scope="function")
async def hold_invoice():
invoice = get_hold_invoice(100)
yield invoice
del invoice