TEST: add helpers and a test to pay external invoice (#1414)

* add helpers and a test to pay external invoice

* skip real test in fakewallet

* formatting

* fix test

* formatting
This commit is contained in:
dni ⚡
2023-02-01 16:54:07 +01:00
committed by GitHub
parent e7802c27ab
commit 3ac6a98adc
3 changed files with 79 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ 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
from tests.helpers import credit_wallet, get_random_invoice_data, get_real_invoice
@pytest_asyncio.fixture(scope="session")
@@ -123,3 +123,10 @@ async def invoice(to_wallet):
invoice = await api_payments_create_invoice(invoiceData, to_wallet)
yield invoice
del invoice
@pytest_asyncio.fixture(scope="session")
async def real_invoice():
invoice = get_real_invoice(100_000, "test-fixture")
yield invoice
del invoice