mirror of
https://github.com/lnbits/lnbits.git
synced 2025-03-17 21:31:55 +01:00
Bug: invalid type converter (#1842)
* temporary test case * remove buggy converter
This commit is contained in:
parent
67d3a4f359
commit
1ab81f6d7e
@ -47,15 +47,6 @@ if settings.lnbits_database_url:
|
||||
lambda value, curs: float(value) if value is not None else None,
|
||||
)
|
||||
)
|
||||
register_type(
|
||||
new_type(
|
||||
(1082, 1083, 1266),
|
||||
"DATE2INT",
|
||||
lambda value, curs: time.mktime(value.timetuple())
|
||||
if value is not None
|
||||
else None,
|
||||
)
|
||||
)
|
||||
|
||||
register_type(new_type((1184, 1114), "TIMESTAMP2INT", _parse_timestamp))
|
||||
else:
|
||||
|
12
tests/core/test_db.py
Normal file
12
tests/core/test_db.py
Normal file
@ -0,0 +1,12 @@
|
||||
from datetime import date
|
||||
|
||||
import pytest
|
||||
|
||||
from lnbits.db import POSTGRES
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_date_conversion(db):
|
||||
if db.type == POSTGRES:
|
||||
row = await db.fetchone("SELECT now()::date")
|
||||
assert row and type(row[0]) == date
|
Loading…
x
Reference in New Issue
Block a user