mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Revert #216 until I can get tests to pass in Travis
Revert "Fix for _sort_desc=sortable_with_nulls test, refs #216" This reverts commit07fc2d113e. Revert "Fixed #216 - paginate correctly when sorting by nullable column" This reverts commit2abe539a0f.
This commit is contained in:
parent
07fc2d113e
commit
5364fa7f33
3 changed files with 14 additions and 61 deletions
|
|
@ -156,7 +156,7 @@ def test_database_page(app_client):
|
|||
}, {
|
||||
'columns': [
|
||||
'pk1', 'pk2', 'content', 'sortable', 'sortable_with_nulls',
|
||||
'sortable_with_nulls_2', 'text',
|
||||
'sortable_with_nulls_2'
|
||||
],
|
||||
'name': 'sortable',
|
||||
'count': 201,
|
||||
|
|
@ -426,25 +426,6 @@ def test_paginate_compound_keys_with_extra_filters(app_client):
|
|||
@pytest.mark.parametrize('query_string,sort_key,human_description_en', [
|
||||
('_sort=sortable', lambda row: row['sortable'], 'sorted by sortable'),
|
||||
('_sort_desc=sortable', lambda row: -row['sortable'], 'sorted by sortable descending'),
|
||||
(
|
||||
'_sort=sortable_with_nulls',
|
||||
lambda row: (
|
||||
1 if row['sortable_with_nulls'] is not None else 0,
|
||||
row['sortable_with_nulls']
|
||||
),
|
||||
'sorted by sortable_with_nulls'
|
||||
),
|
||||
(
|
||||
'_sort_desc=sortable_with_nulls',
|
||||
lambda row: (
|
||||
1 if row['sortable_with_nulls'] is None else 0,
|
||||
-row['sortable_with_nulls'] if row['sortable_with_nulls'] is not None else 0,
|
||||
row['content']
|
||||
),
|
||||
'sorted by sortable_with_nulls descending'
|
||||
),
|
||||
# text column contains '$null' - ensure it doesn't confuse pagination:
|
||||
('_sort=text', lambda row: row['text'], 'sorted by text'),
|
||||
])
|
||||
def test_sortable(app_client, query_string, sort_key, human_description_en):
|
||||
path = '/test_tables/sortable.json?_shape=objects&{}'.format(query_string)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue