mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Search now applies to current filters
Combined search into the same form as filters. Closes #133
This commit is contained in:
parent
8a37baba14
commit
a802cbee74
5 changed files with 42 additions and 11 deletions
|
|
@ -404,6 +404,23 @@ def test_existing_filter_redirects(app_client):
|
|||
assert '?' not in response.headers['Location']
|
||||
|
||||
|
||||
def test_empty_search_parameter_gets_removed(app_client):
|
||||
path_base = app_client.get(
|
||||
'/test_tables/simple_primary_key', allow_redirects=False, gather_request=False
|
||||
).headers['Location']
|
||||
path = path_base + '?' + urllib.parse.urlencode({
|
||||
'_search': '',
|
||||
'_filter_column': 'name',
|
||||
'_filter_op': 'exact',
|
||||
'_filter_value': 'chidi',
|
||||
})
|
||||
response = app_client.get(path, allow_redirects=False, gather_request=False)
|
||||
assert response.status == 302
|
||||
assert response.headers['Location'].endswith(
|
||||
'?name__exact=chidi'
|
||||
)
|
||||
|
||||
|
||||
TABLES = '''
|
||||
CREATE TABLE simple_primary_key (
|
||||
pk varchar(30) primary key,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue