mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Redirect /-/config to /-/settings, closes #1103
This commit is contained in:
parent
3159263f05
commit
2a3d5b720b
7 changed files with 43 additions and 14 deletions
|
|
@ -1324,8 +1324,8 @@ def test_versions_json(app_client):
|
|||
assert "compile_options" in response.json["sqlite"]
|
||||
|
||||
|
||||
def test_config_json(app_client):
|
||||
response = app_client.get("/-/config.json")
|
||||
def test_settings_json(app_client):
|
||||
response = app_client.get("/-/settings.json")
|
||||
assert {
|
||||
"default_page_size": 50,
|
||||
"default_facet_size": 30,
|
||||
|
|
@ -1350,6 +1350,19 @@ def test_config_json(app_client):
|
|||
} == response.json
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"path,expected_redirect",
|
||||
(
|
||||
("/-/config.json", "/-/settings.json"),
|
||||
("/-/config", "/-/settings"),
|
||||
),
|
||||
)
|
||||
def test_config_redirects_to_settings(app_client, path, expected_redirect):
|
||||
response = app_client.get(path, allow_redirects=False)
|
||||
assert response.status == 301
|
||||
assert response.headers["Location"] == expected_redirect
|
||||
|
||||
|
||||
def test_page_size_matching_max_returned_rows(
|
||||
app_client_returned_rows_matches_page_size,
|
||||
):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue