Add HTML5 authoring apply summaries
CI / python (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-05-17 02:22:10 +03:00
parent dde672202c
commit 8f2a17b24a
2 changed files with 45 additions and 1 deletions
+31 -1
View File
@@ -1,6 +1,7 @@
from pathlib import Path
from uuid import uuid4
import re
import time
from uuid import uuid4
import zipfile
from fastapi.testclient import TestClient
@@ -3045,6 +3046,35 @@ def test_authoring_metadata_object_preview_and_apply(tmp_path: Path):
assert "Expected version id does not match current metadata preview" in html5_blocked_apply.text
assert "<html" not in html5_blocked_apply.text
html5_expected_version = re.search(r'name="expected_next_version_id" value="([^"]+)"', html5_preview.text)
assert html5_expected_version is not None
html5_apply = client.post(
f"/html5/projects/{project_id}/authoring/apply-metadata-object",
data={
"object_kind": "DOCUMENT",
"name": "ЗаявкаНаЗакупкуHtml5",
"synonym": "Заявка на закупку HTML5",
"attributes": "Контрагент:СправочникСсылка.Контрагенты",
"tabular_sections": "Товары[Номенклатура:СправочникСсылка.Номенклатура;Количество:Число]",
"forms": "ФормаДокумента",
"commands": "Заполнить:ЗаполнитьКоманда",
"task_id": "task.metadata",
"session_id": "session.metadata",
"user_id": "dev.ivan",
"expected_next_version_id": html5_expected_version.group(1),
"approved_by": "dev.ivan",
"approval_note": "html5 metadata draft checked",
},
)
assert html5_apply.status_code == 200
assert "text/html" in html5_apply.headers["content-type"]
assert "data-html5-metadata-apply-result" in html5_apply.text
assert "data-html5-authoring-apply-summary" in html5_apply.text
assert 'data-html5-authoring-apply-kind="metadata"' in html5_apply.text
assert "METADATA_DRAFT_APPLIED_TO_WORKSPACE" in html5_apply.text
assert "ЗаявкаНаЗакупкуHtml5" in html5_apply.text
assert "<html" not in html5_apply.text
apply_response = client.post(
f"/projects/{project_id}/authoring/apply-metadata-object",
json={