mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Support for generated columns
* Support for generated columns, closes #1116 * Show SQLite version in pytest report header * Use table_info() if SQLite < 3.26.0 * Cache sqlite_version() rather than re-calculate every time * Adjust test_database_page for SQLite 3.26.0 or higher
This commit is contained in:
parent
49b6297fb7
commit
461670a0b8
9 changed files with 135 additions and 26 deletions
|
|
@ -2,7 +2,8 @@
|
|||
Tests for the datasette.database.Database class
|
||||
"""
|
||||
from datasette.database import Database, Results, MultipleValues
|
||||
from datasette.utils import sqlite3, Column
|
||||
from datasette.utils.sqlite import sqlite3
|
||||
from datasette.utils import Column
|
||||
from .fixtures import app_client
|
||||
import pytest
|
||||
import time
|
||||
|
|
@ -120,6 +121,7 @@ async def test_table_columns(db, table, expected):
|
|||
notnull=0,
|
||||
default_value=None,
|
||||
is_pk=1,
|
||||
hidden=0,
|
||||
),
|
||||
Column(
|
||||
cid=1,
|
||||
|
|
@ -128,6 +130,7 @@ async def test_table_columns(db, table, expected):
|
|||
notnull=0,
|
||||
default_value=None,
|
||||
is_pk=0,
|
||||
hidden=0,
|
||||
),
|
||||
Column(
|
||||
cid=2,
|
||||
|
|
@ -136,6 +139,7 @@ async def test_table_columns(db, table, expected):
|
|||
notnull=0,
|
||||
default_value=None,
|
||||
is_pk=0,
|
||||
hidden=0,
|
||||
),
|
||||
Column(
|
||||
cid=3,
|
||||
|
|
@ -144,6 +148,7 @@ async def test_table_columns(db, table, expected):
|
|||
notnull=0,
|
||||
default_value=None,
|
||||
is_pk=0,
|
||||
hidden=0,
|
||||
),
|
||||
Column(
|
||||
cid=4,
|
||||
|
|
@ -152,6 +157,7 @@ async def test_table_columns(db, table, expected):
|
|||
notnull=0,
|
||||
default_value=None,
|
||||
is_pk=0,
|
||||
hidden=0,
|
||||
),
|
||||
Column(
|
||||
cid=5,
|
||||
|
|
@ -160,6 +166,7 @@ async def test_table_columns(db, table, expected):
|
|||
notnull=0,
|
||||
default_value=None,
|
||||
is_pk=0,
|
||||
hidden=0,
|
||||
),
|
||||
Column(
|
||||
cid=6,
|
||||
|
|
@ -168,6 +175,7 @@ async def test_table_columns(db, table, expected):
|
|||
notnull=0,
|
||||
default_value=None,
|
||||
is_pk=0,
|
||||
hidden=0,
|
||||
),
|
||||
Column(
|
||||
cid=7,
|
||||
|
|
@ -176,6 +184,7 @@ async def test_table_columns(db, table, expected):
|
|||
notnull=0,
|
||||
default_value=None,
|
||||
is_pk=0,
|
||||
hidden=0,
|
||||
),
|
||||
Column(
|
||||
cid=8,
|
||||
|
|
@ -184,6 +193,7 @@ async def test_table_columns(db, table, expected):
|
|||
notnull=0,
|
||||
default_value=None,
|
||||
is_pk=0,
|
||||
hidden=0,
|
||||
),
|
||||
Column(
|
||||
cid=9,
|
||||
|
|
@ -192,6 +202,7 @@ async def test_table_columns(db, table, expected):
|
|||
notnull=0,
|
||||
default_value=None,
|
||||
is_pk=0,
|
||||
hidden=0,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
@ -205,6 +216,7 @@ async def test_table_columns(db, table, expected):
|
|||
notnull=0,
|
||||
default_value=None,
|
||||
is_pk=1,
|
||||
hidden=0,
|
||||
),
|
||||
Column(
|
||||
cid=1,
|
||||
|
|
@ -213,6 +225,7 @@ async def test_table_columns(db, table, expected):
|
|||
notnull=0,
|
||||
default_value=None,
|
||||
is_pk=2,
|
||||
hidden=0,
|
||||
),
|
||||
Column(
|
||||
cid=2,
|
||||
|
|
@ -221,6 +234,7 @@ async def test_table_columns(db, table, expected):
|
|||
notnull=0,
|
||||
default_value=None,
|
||||
is_pk=0,
|
||||
hidden=0,
|
||||
),
|
||||
Column(
|
||||
cid=3,
|
||||
|
|
@ -229,6 +243,7 @@ async def test_table_columns(db, table, expected):
|
|||
notnull=0,
|
||||
default_value=None,
|
||||
is_pk=0,
|
||||
hidden=0,
|
||||
),
|
||||
Column(
|
||||
cid=4,
|
||||
|
|
@ -237,6 +252,7 @@ async def test_table_columns(db, table, expected):
|
|||
notnull=0,
|
||||
default_value=None,
|
||||
is_pk=0,
|
||||
hidden=0,
|
||||
),
|
||||
Column(
|
||||
cid=5,
|
||||
|
|
@ -245,6 +261,7 @@ async def test_table_columns(db, table, expected):
|
|||
notnull=0,
|
||||
default_value=None,
|
||||
is_pk=0,
|
||||
hidden=0,
|
||||
),
|
||||
Column(
|
||||
cid=6,
|
||||
|
|
@ -253,6 +270,7 @@ async def test_table_columns(db, table, expected):
|
|||
notnull=0,
|
||||
default_value=None,
|
||||
is_pk=0,
|
||||
hidden=0,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue