fix tests settings

This commit is contained in:
dni ⚡
2022-10-03 16:46:56 +02:00
parent f9de542361
commit 2479fc15f5
2 changed files with 4 additions and 4 deletions

View File

@@ -10,7 +10,7 @@ from lnbits.core.crud import create_account, create_wallet, get_wallet
from lnbits.core.models import BalanceCheck, Payment, User, Wallet from lnbits.core.models import BalanceCheck, Payment, User, Wallet
from lnbits.core.views.api import CreateInvoiceData, api_payments_create_invoice from lnbits.core.views.api import CreateInvoiceData, api_payments_create_invoice
from lnbits.db import Database from lnbits.db import Database
from lnbits.settings import HOST, PORT 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
@@ -38,7 +38,7 @@ def app(event_loop):
@pytest_asyncio.fixture(scope="session") @pytest_asyncio.fixture(scope="session")
async def client(app): async def client(app):
client = AsyncClient(app=app, base_url=f"http://{HOST}:{PORT}") client = AsyncClient(app=app, base_url=f"http://{settings.host}:{settings.port}")
yield client yield client
await client.aclose() await client.aclose()

View File

@@ -9,7 +9,7 @@ from lnbits.extensions.bleskomat.helpers import (
generate_bleskomat_lnurl_signature, generate_bleskomat_lnurl_signature,
query_to_signing_payload, query_to_signing_payload,
) )
from lnbits.settings import HOST, PORT from lnbits.settings import settings
from tests.conftest import client from tests.conftest import client
from tests.extensions.bleskomat.conftest import bleskomat, lnurl from tests.extensions.bleskomat.conftest import bleskomat, lnurl
from tests.helpers import credit_wallet, is_regtest from tests.helpers import credit_wallet, is_regtest
@@ -90,7 +90,7 @@ async def test_bleskomat_lnurl_api_valid_signature(client, bleskomat):
assert data["minWithdrawable"] == 1000 assert data["minWithdrawable"] == 1000
assert data["maxWithdrawable"] == 1000 assert data["maxWithdrawable"] == 1000
assert data["defaultDescription"] == "test valid sig" assert data["defaultDescription"] == "test valid sig"
assert data["callback"] == f"http://{HOST}:{PORT}/bleskomat/u" assert data["callback"] == f"http://{settings.host}:{settings.port}/bleskomat/u"
k1 = data["k1"] k1 = data["k1"]
lnurl = await get_bleskomat_lnurl(secret=k1) lnurl = await get_bleskomat_lnurl(secret=k1)
assert lnurl assert lnurl