Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cekk committed Aug 1, 2024
1 parent 7245c8d commit 8d1a515
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 13 deletions.
8 changes: 8 additions & 0 deletions src/iosanita/contenttypes/interfaces/struttura.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ class IStruttura(model.Schema, IIosanitaContenttypes):
fields=["orari"],
)

model.fieldset(
"persone_struttura",
label=_("persone_struttura_label", default="Persone struttura"),
fields=[
"responsabile_correlato",
"coordinatore_correlato",
],
)
model.fieldset(
"contenuti_collegati",
label=_("contenuti_collegati_label", default="Contenuti collegati"),
Expand Down
4 changes: 2 additions & 2 deletions src/iosanita/contenttypes/tests/test_ct_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def test_event_required_fields(self):
"costo",
"descrizione_estesa",
"end",
"punti_di_contatto",
"pdc_correlato",
"start",
"tipologia_evento",
"title",
Expand Down Expand Up @@ -188,7 +188,7 @@ def test_event_fields_contatti_fieldset(self):
"organizzato_da_interno",
"organizzato_da_esterno",
"patrocinato_da",
"punti_di_contatto",
"pdc_correlato",
],
)

Expand Down
4 changes: 2 additions & 2 deletions src/iosanita/contenttypes/tests/test_ct_persona.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_persona_required_fields(self):
"description",
"incarico",
"nome",
"punti_di_contatto",
"pdc_correlato",
]
),
)
Expand Down Expand Up @@ -170,7 +170,7 @@ def test_persona_fields_contatti_fieldset(self):
Get the list from restapi
"""
resp = self.api_session.get("@types/Persona").json()
self.assertEqual(resp["fieldsets"][5]["fields"], ["punti_di_contatto"])
self.assertEqual(resp["fieldsets"][5]["fields"], ["pdc_correlato"])

def test_persona_fields_biografia_fieldset(self):
"""
Expand Down
4 changes: 2 additions & 2 deletions src/iosanita/contenttypes/tests/test_ct_servizio.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def test_servizio_required_fields(self):
"orari",
"uo_correlata",
"responsabile_correlato",
"punti_di_contatto",
"pdc_correlato",
]
),
)
Expand Down Expand Up @@ -189,7 +189,7 @@ def test_servizio_fields_contatti_fieldset(self):
Get the list from restapi
"""
resp = self.api_session.get("@types/Servizio").json()
self.assertEqual(resp["fieldsets"][7]["fields"], ["punti_di_contatto"])
self.assertEqual(resp["fieldsets"][7]["fields"], ["pdc_correlato"])

def test_servizio_fields_cosa_e_fieldset(self):
"""
Expand Down
6 changes: 3 additions & 3 deletions src/iosanita/contenttypes/tests/test_ct_struttura.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def test_struttura_required_fields(self):
"come_accedere",
# "description", is required from schema_tweaks.py but it doesn't apply in test
"orari",
"punti_di_contatto",
"pdc_correlato",
"responsabile_correlato",
"title",
"servizi",
Expand Down Expand Up @@ -187,7 +187,7 @@ def test_struttura_fields_contatti_fieldset(self):
Get the list from restapi
"""
resp = self.api_session.get("@types/Struttura").json()
self.assertEqual(resp["fieldsets"][6]["fields"], ["punti_di_contatto"])
self.assertEqual(resp["fieldsets"][6]["fields"], ["pdc_correlato"])

def test_struttura_fields_servizi_fieldset(self):
"""
Expand All @@ -203,7 +203,7 @@ def test_struttura_fields_persone_struttura_fieldset(self):
resp = self.api_session.get("@types/Struttura").json()
self.assertEqual(
resp["fieldsets"][8]["fields"],
["responsabile_correlato", "coordinatore_correlato", "personale_correlato"],
["responsabile_correlato", "coordinatore_correlato"],
)

def test_struttura_fields_correlati_fieldset(self):
Expand Down
4 changes: 2 additions & 2 deletions src/iosanita/contenttypes/tests/test_ct_uo.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_uo_required_fields(self):
"competenze",
# "description", is required from schema_tweaks.py but it doesn't apply in test
"orari",
"punti_di_contatto",
"pdc_correlato",
"responsabile_correlato",
"title",
]
Expand Down Expand Up @@ -179,7 +179,7 @@ def test_uo_fields_contatti_fieldset(self):
Get the list from restapi
"""
resp = self.api_session.get("@types/UnitaOrganizzativa").json()
self.assertEqual(resp["fieldsets"][6]["fields"], ["punti_di_contatto"])
self.assertEqual(resp["fieldsets"][6]["fields"], ["pdc_correlato"])

def test_uo_fields_documenti_fieldset(self):
"""
Expand Down
4 changes: 2 additions & 2 deletions src/iosanita/contenttypes/tests/test_custom_validations.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_event_raise_badrequest_if_missing_organizzato_da(self):
"descrizione_estesa": {"blocks": {}},
"end": "2024-07-26T10:00:00+00:00",
"geolocation": {"latitude": 44.821502405601, "longitude": 11.632933286779},
"punti_di_contatto": [{"@id": "/pdc"}],
"pdc_correlato": [{"@id": "/pdc"}],
"start": "2024-07-26T09:00:00+00:00",
"tipologia_evento": "giornata-informativa",
"title": "titolo",
Expand Down Expand Up @@ -109,7 +109,7 @@ def test_raise_bad_request_if_missing_a_chi_si_rivolge_fields(self):
"come_accedere": {"blocks": {}},
"orari_apertura": {"blocks": {}},
"description": "asdasd",
"punti_di_contatto": [{"@id": "/pdc"}],
"pdc_correlato": [{"@id": "/pdc"}],
"title": "titolo",
"@type": "Struttura",
}
Expand Down

0 comments on commit 8d1a515

Please sign in to comment.