(models/api) add document model and API

We do this by making copies of existing Template and TemplateAccess
models and API. A little refactoring is done to try to limit duplicate
code.
This commit is contained in:
Samuel Paccoud - DINUM
2024-04-03 18:50:28 +02:00
committed by Anthony LC
parent 0024cc5814
commit 3e0739cd0a
17 changed files with 2978 additions and 247 deletions

View File

@@ -107,7 +107,7 @@ def test_api_templates_generate_document_related(via, mock_user_get_teams):
data = {"body": "# Test markdown body"}
response = client.post(
f"/api/v1.0/templates/{access.template.id!s}/generate-document/",
f"/api/v1.0/templates/{access.template_id!s}/generate-document/",
data,
format="json",
)

View File

@@ -108,7 +108,7 @@ def test_api_templates_list_pagination(
client.force_login(user)
template_ids = [
str(access.template.id)
str(access.template_id)
for access in factories.UserTemplateAccessFactory.create_batch(3, user=user)
]