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
|
|
@ -1,6 +1,7 @@
|
|||
from .fixtures import (
|
||||
app_client,
|
||||
app_client_longer_time_limit,
|
||||
app_client_returend_rows_matches_page_size,
|
||||
generate_compound_rows,
|
||||
generate_sortable_rows,
|
||||
METADATA,
|
||||
|
|
@ -9,6 +10,7 @@ import pytest
|
|||
|
||||
pytest.fixture(scope='module')(app_client)
|
||||
pytest.fixture(scope='module')(app_client_longer_time_limit)
|
||||
pytest.fixture(scope='module')(app_client_returend_rows_matches_page_size)
|
||||
|
||||
|
||||
def test_homepage(app_client):
|
||||
|
|
@ -691,3 +693,16 @@ def test_plugins_json(app_client):
|
|||
'static': False,
|
||||
'templates': False
|
||||
} in response.json
|
||||
|
||||
|
||||
def test_page_size_matching_max_returned_rows(app_client_returend_rows_matches_page_size):
|
||||
fetched = []
|
||||
path = '/test_tables/no_primary_key.json'
|
||||
while path:
|
||||
response = app_client_returend_rows_matches_page_size.get(
|
||||
path, gather_request=False
|
||||
)
|
||||
fetched.extend(response.json['rows'])
|
||||
assert len(response.json['rows']) in (1, 50)
|
||||
path = response.json['next_url']
|
||||
assert 201 == len(fetched)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue