Mark HTML5 responses as dynamic
This commit is contained in:
@@ -44,6 +44,12 @@ def assert_html5_contract(text: str, *markers: str, full_page: bool = False) ->
|
||||
assert marker in text
|
||||
|
||||
|
||||
def assert_html5_response_contract(response, *markers: str, full_page: bool = False) -> None:
|
||||
assert "text/html" in response.headers["content-type"]
|
||||
assert response.headers["cache-control"] == "no-cache, no-transform"
|
||||
assert_html5_contract(response.text, *markers, full_page=full_page)
|
||||
|
||||
|
||||
def test_cors_allows_lan_panel_origin():
|
||||
client = TestClient(app)
|
||||
response = client.options(
|
||||
@@ -301,7 +307,7 @@ def test_html5_contracts_are_server_rendered_and_stable(tmp_path: Path):
|
||||
for path, markers in full_pages:
|
||||
response = client.get(path)
|
||||
assert response.status_code == 200
|
||||
assert_html5_contract(response.text, *markers, full_page=True)
|
||||
assert_html5_response_contract(response, *markers, full_page=True)
|
||||
|
||||
partials = [
|
||||
(f"/html5/projects/{project_id}/symbols", {"q": "Проверить"}, ("data-html5-symbol",)),
|
||||
@@ -316,7 +322,7 @@ def test_html5_contracts_are_server_rendered_and_stable(tmp_path: Path):
|
||||
for path, params, markers in partials:
|
||||
response = client.get(path, params=params)
|
||||
assert response.status_code == 200
|
||||
assert_html5_contract(response.text, *markers)
|
||||
assert_html5_response_contract(response, *markers)
|
||||
|
||||
|
||||
def test_html5_project_index_creates_project_with_fragment():
|
||||
|
||||
Reference in New Issue
Block a user