Redirect /-/config to /-/settings, closes #1103

This commit is contained in:
Simon Willison 2020-11-24 12:19:14 -08:00
commit 2a3d5b720b
7 changed files with 43 additions and 14 deletions

View file

@ -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,
):