Fix pagination when sorted by expanded foreign key

Closes #489
This commit is contained in:
Simon Willison 2019-05-27 19:23:18 -07:00
commit 9c58d048ec
2 changed files with 4 additions and 0 deletions

View file

@ -753,6 +753,8 @@ def test_table_with_reserved_word_name(app_client):
("/fixtures/123_starts_with_digits.json", 0, 1),
# Ensure faceting doesn't break pagination:
("/fixtures/compound_three_primary_keys.json?_facet=pk1", 1001, 21),
# Paginating while sorted by an expanded foreign key should work
("/fixtures/roadside_attraction_characteristics.json?_size=2&_sort=attraction_id&_labels=on", 5, 3),
],
)
def test_paginate_tables_and_views(app_client, path, expected_rows, expected_pages):