request.url now respects force_https_urls, closes #781

This commit is contained in:
Simon Willison 2020-05-28 10:09:32 -07:00
commit 7bb30c1f11
3 changed files with 14 additions and 0 deletions

View file

@ -1676,6 +1676,10 @@ def test_config_force_https_urls():
"toggle_url"
].startswith("https://")
assert response.json["suggested_facets"][0]["toggle_url"].startswith("https://")
# Also confirm that request.url and request.scheme are set correctly
response = client.get("/")
assert client.ds._last_request.url.startswith("https://")
assert client.ds._last_request.scheme == "https"
def test_infinity_returned_as_null(app_client):