Add a payments page for admin (#2910)

This commit is contained in:
Tiago Vasconcelos 2025-02-06 12:48:54 +00:00 committed by GitHub
parent c1d26bb274
commit 34a959f0bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 1416 additions and 54 deletions

View file

@ -337,10 +337,10 @@ async def test_get_payments(client, inkey_fresh_headers_to, fake_payments):
payments = await get_payments({"sortby": "amount", "direction": "asc"})
assert payments[-1].amount > payments[0].amount
payments = await get_payments({"search": "aaa"})
payments = await get_payments({"search": "xxx"})
assert len(payments) == 1
payments = await get_payments({"search": "aa"})
payments = await get_payments({"search": "xx"})
assert len(payments) == 2
# amount is in msat

View file

@ -117,7 +117,6 @@ async def test_login_usr_not_allowed_for_admin_without_credentials(
response = await http_client.get(
f"/admin/api/v1/settings?usr={settings.super_user}"
)
print("### response", response.text)
assert response.status_code == 403
assert (
response.json().get("detail") == "User id only access for admins is forbidden."

View file

@ -276,9 +276,9 @@ async def fake_payments(client, inkey_fresh_headers_to):
await asyncio.sleep(1)
fake_data = [
CreateInvoice(amount=10, memo="aaaa", out=False),
CreateInvoice(amount=100, memo="bbbb", out=False),
CreateInvoice(amount=1000, memo="aabb", out=False),
CreateInvoice(amount=10, memo="xxxx", out=False),
CreateInvoice(amount=100, memo="yyyy", out=False),
CreateInvoice(amount=1000, memo="xxyy", out=False),
]
for invoice in fake_data: