Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cekk committed Sep 20, 2024
1 parent eaad9c8 commit bf1faeb
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/iosanita/contenttypes/tests/test_custom_validations.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,22 @@ def test_raise_bad_request_if_missing_a_chi_si_rivolge_fields(self):

resp = self.api_session.post(self.portal_url, json=data)
self.assertEqual(resp.status_code, 400)

self.assertEqual(
json.loads(resp.json()["message"]),
{
"error": {
[
{
"field": "a_chi_si_rivolge",
"message": "Compila almeno uno di questi campi.",
},
{
"field": "a_chi_si_rivolge_tassonomia",
"message": "Compila almeno uno di questi campi.",
},
{
"message": 'Devi compilare almeno uno dei due campi del tab "A chi si rivolge".'
}
},
},
],
)

# now compile only a_chi_si_rivolge_tassonomia
Expand Down

0 comments on commit bf1faeb

Please sign in to comment.