remove pyproject artifacts
import conv fix postgres url fix migration fixup timestamp postgresql fixup more timestamp fix migrations fix migrations fix statement add psycopg2 for conv tests expiry timestamp flaku fix expiry more wait parse to int remove time from filters
This commit is contained in:
+7
-8
@@ -22,7 +22,7 @@ from lnbits.core.crud import (
|
||||
from lnbits.core.models import CreateInvoice, PaymentState
|
||||
from lnbits.core.services import update_wallet_balance
|
||||
from lnbits.core.views.payment_api import api_payments_create_invoice
|
||||
from lnbits.db import DB_TYPE, SQLITE, Database
|
||||
from lnbits.db import Database
|
||||
from lnbits.settings import settings
|
||||
from tests.helpers import (
|
||||
get_random_invoice_data,
|
||||
@@ -182,9 +182,8 @@ async def invoice(to_wallet):
|
||||
async def fake_payments(client, adminkey_headers_from):
|
||||
# Because sqlite only stores timestamps with milliseconds
|
||||
# we have to wait a second to ensure a different timestamp than previous invoices
|
||||
if DB_TYPE == SQLITE:
|
||||
await asyncio.sleep(1)
|
||||
ts = time()
|
||||
await asyncio.sleep(1)
|
||||
ts = int(time())
|
||||
|
||||
fake_data = [
|
||||
CreateInvoice(amount=10, memo="aaaa", out=False),
|
||||
@@ -197,9 +196,9 @@ async def fake_payments(client, adminkey_headers_from):
|
||||
"/api/v1/payments", headers=adminkey_headers_from, json=invoice.dict()
|
||||
)
|
||||
assert response.is_success
|
||||
await update_payment_status(
|
||||
response.json()["checking_id"], status=PaymentState.SUCCESS
|
||||
)
|
||||
data = response.json()
|
||||
assert data["checking_id"]
|
||||
await update_payment_status(data["checking_id"], status=PaymentState.SUCCESS)
|
||||
|
||||
params = {"time[ge]": ts, "time[le]": time()}
|
||||
params = {"time[ge]": ts, "time[le]": int(time())}
|
||||
return fake_data, params
|
||||
|
||||
Reference in New Issue
Block a user