Skip to content

Commit

Permalink
[#233] Fix validation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmursa-dev committed Dec 23, 2024
1 parent 6853191 commit 3f34a6a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2121,7 +2121,7 @@ def test_invalid_validation_partij_identificator_code_objecttype(self):
self.assertEqual(response.data["title"], "Invalid input.")
self.assertEqual(
response.data["invalid_params"][0]["name"],
"partijIdentificator.codeObjecttype",
"partijIdentificatorCodeObjecttype",
)
self.assertEqual(response.data["invalid_params"][0]["code"], "invalid")
self.assertEqual(
Expand Down Expand Up @@ -2149,7 +2149,7 @@ def test_invalid_validation_partij_identificator_code_soort_object_id(self):
self.assertEqual(response.data["title"], "Invalid input.")
self.assertEqual(
response.data["invalid_params"][0]["name"],
"partijIdentificator.codeSoortObjectId",
"partijIdentificatorCodeSoortObjectId",
)
self.assertEqual(response.data["invalid_params"][0]["code"], "invalid")
self.assertEqual(
Expand Down Expand Up @@ -2177,7 +2177,7 @@ def test_invalid_validation_partij_identificator_object_id(self):
self.assertEqual(response.data["title"], "Invalid input.")
self.assertEqual(
response.data["invalid_params"][0]["name"],
"partijIdentificator.ObjectId",
"partijIdentificatorObjectId",
)
self.assertEqual(response.data["invalid_params"][0]["code"], "invalid")
self.assertEqual(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def validate_code_objecttype(self) -> None:
if self.code_objecttype not in self.REGISTERS.get(self.code_register, {}):
raise ValidationError(
{
"partijIdentificator.codeObjecttype": _(
"partij_identificator_code_objecttype": _(
"codeObjecttype keuzes zijn beperkt op basis van codeRegister."
)
}
Expand All @@ -136,7 +136,7 @@ def validate_code_soort_object_id(self) -> None:
):
raise ValidationError(
{
"partijIdentificator.codeSoortObjectId": _(
"partij_identificator_code_soort_object_id": _(
"codeSoortObjectId keuzes zijn beperkt op basis van codeObjecttype."
)
}
Expand All @@ -158,7 +158,7 @@ def validate_object_id(self) -> None:
except ValidationError as error:
raise ValidationError(
{
"partijIdentificator.ObjectId": _(
"partij_identificator_object_id": _(
"ObjectId ongeldig, reden: %s" % (error.message)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_code_objecttype_not_found_in_code_register(self):

details = error.exception.message_dict
self.assertEqual(
details["partijIdentificator.codeObjecttype"][0],
details["partij_identificator_code_objecttype"][0],
"codeObjecttype keuzes zijn beperkt op basis van codeRegister.",
)

Expand Down Expand Up @@ -130,7 +130,7 @@ def test_code_soort_object_id_not_found_in_code_objecttype(self):
validator.validate_code_soort_object_id()
details = error.exception.message_dict
self.assertEqual(
details["partijIdentificator.codeSoortObjectId"][0],
details["partij_identificator_code_soort_object_id"][0],
"codeSoortObjectId keuzes zijn beperkt op basis van codeObjecttype.",
)

Expand Down Expand Up @@ -228,7 +228,7 @@ def test_object_id_invalid_len_bsn(self):
validator.validate_object_id()
details = error.exception.message_dict
self.assertEqual(
details["partijIdentificator.ObjectId"][0],
details["partij_identificator_object_id"][0],
"ObjectId ongeldig, reden: The length must be in: [8, 9]",
)

Expand All @@ -244,7 +244,7 @@ def test_object_id_invalid_digit_bsn(self):
validator.validate_object_id()
details = error.exception.message_dict
self.assertEqual(
details["partijIdentificator.ObjectId"][0],
details["partij_identificator_object_id"][0],
"ObjectId ongeldig, reden: Expected a numerical value",
)

Expand All @@ -260,7 +260,7 @@ def test_object_id_invalid_proef11_bsn(self):
validator.validate_object_id()
details = error.exception.message_dict
self.assertEqual(
details["partijIdentificator.ObjectId"][0],
details["partij_identificator_object_id"][0],
"ObjectId ongeldig, reden: Invalid code",
)

Expand All @@ -276,7 +276,7 @@ def test_object_id_invalid_vestigingsnummer(self):
validator.validate_object_id()
details = error.exception.message_dict
self.assertEqual(
details["partijIdentificator.ObjectId"][0],
details["partij_identificator_object_id"][0],
"ObjectId ongeldig, reden: The length must be in: [12]",
)

Expand All @@ -292,7 +292,7 @@ def test_object_id_invalid_rsin(self):
validator.validate_object_id()
details = error.exception.message_dict
self.assertEqual(
details["partijIdentificator.ObjectId"][0],
details["partij_identificator_object_id"][0],
"ObjectId ongeldig, reden: The length must be in: [8, 9]",
)

Expand All @@ -308,6 +308,6 @@ def test_object_id_invalid_kvknummer(self):
validator.validate_object_id()
details = error.exception.message_dict
self.assertEqual(
details["partijIdentificator.ObjectId"][0],
details["partij_identificator_object_id"][0],
"ObjectId ongeldig, reden: The length must be in: [8]",
)

0 comments on commit 3f34a6a

Please sign in to comment.