lnbits-legend/tests/core/test_helpers_query.py
dni ⚡ 7ce4eddb0e
feat: add group_by to fetch_page (#2140)
---------

Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
2024-03-12 13:55:38 +01:00

21 lines
567 B
Python

import pytest
from lnbits.helpers import (
insert_query,
update_query,
)
from tests.helpers import DbTestModel
test = DbTestModel(id=1, name="test", value="yes")
@pytest.mark.asyncio
async def test_helpers_insert_query():
q = insert_query("test_helpers_query", test)
assert q == "INSERT INTO test_helpers_query (id, name, value) VALUES (?, ?, ?)"
@pytest.mark.asyncio
async def test_helpers_update_query():
q = update_query("test_helpers_query", test)
assert q == "UPDATE test_helpers_query SET id = ?, name = ?, value = ? WHERE id = ?"