From 778b88a148d60e3907314cf81bd190d4048aff40 Mon Sep 17 00:00:00 2001 From: Cecilie Seim <68303562+tilen1976@users.noreply.github.com> Date: Mon, 1 Jul 2024 09:28:06 +0200 Subject: [PATCH] set definition uri obligatory to false - update test document percent complete because removing definition uri from obligatory changes det percent completed (#356) --- src/datadoc/frontend/fields/display_variables.py | 2 +- tests/backend/test_datadoc_metadata.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/datadoc/frontend/fields/display_variables.py b/src/datadoc/frontend/fields/display_variables.py index 242135b6..e7d0d491 100644 --- a/src/datadoc/frontend/fields/display_variables.py +++ b/src/datadoc/frontend/fields/display_variables.py @@ -98,7 +98,7 @@ class VariableIdentifiers(str, Enum): identifier=VariableIdentifiers.DEFINITION_URI.value, display_name="Definition URI", description="Oppgi lenke (URI) til tilhørende variabel i VarDef.", - obligatory=True, + obligatory=False, ), VariableIdentifiers.DIRECT_PERSON_IDENTIFYING: MetadataCheckboxField( identifier=VariableIdentifiers.DIRECT_PERSON_IDENTIFYING.value, diff --git a/tests/backend/test_datadoc_metadata.py b/tests/backend/test_datadoc_metadata.py index f3d8863b..8501854d 100644 --- a/tests/backend/test_datadoc_metadata.py +++ b/tests/backend/test_datadoc_metadata.py @@ -83,7 +83,7 @@ def test_metadata_document_percent_complete(metadata: DataDocMetadata): metadata.dataset = document.dataset # type: ignore [assignment] metadata.variables = document.variables # type: ignore [assignment] - assert metadata.percent_complete == 11 # noqa: PLR2004 + assert metadata.percent_complete == 12 # noqa: PLR2004 def test_write_metadata_document(