mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
If max_returned_rows==page_size, increment max_returned_rows
Fixes #230, where if the two were equal pagination didn't work correctly.
This commit is contained in:
parent
02ee31c8b4
commit
4504d5160b
3 changed files with 28 additions and 6 deletions
|
|
@ -9,7 +9,7 @@ import tempfile
|
|||
import time
|
||||
|
||||
|
||||
def app_client(sql_time_limit_ms=None):
|
||||
def app_client(sql_time_limit_ms=None, max_returned_rows=None):
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
filepath = os.path.join(tmpdir, 'test_tables.db')
|
||||
conn = sqlite3.connect(filepath)
|
||||
|
|
@ -21,7 +21,7 @@ def app_client(sql_time_limit_ms=None):
|
|||
ds = Datasette(
|
||||
[filepath],
|
||||
page_size=50,
|
||||
max_returned_rows=100,
|
||||
max_returned_rows=max_returned_rows or 100,
|
||||
sql_time_limit_ms=sql_time_limit_ms or 20,
|
||||
metadata=METADATA,
|
||||
plugins_dir=plugins_dir,
|
||||
|
|
@ -38,6 +38,10 @@ def app_client_longer_time_limit():
|
|||
yield from app_client(200)
|
||||
|
||||
|
||||
def app_client_returend_rows_matches_page_size():
|
||||
yield from app_client(max_returned_rows=50)
|
||||
|
||||
|
||||
def generate_compound_rows(num):
|
||||
for a, b, c in itertools.islice(
|
||||
itertools.product(string.ascii_lowercase, repeat=3), num
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue