Skip to content

Commit

Permalink
[#233] Check tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmursa-dev committed Dec 19, 2024
1 parent faa988d commit e912771
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import datetime

from django.core.exceptions import ValidationError
from rest_framework.serializers import ValidationError
from django.utils.translation import gettext as _

from rest_framework import status
Expand Down Expand Up @@ -2118,8 +2118,9 @@ def test_invalid_validation_partij_identificator_code_objecttype(self):
}

# ValidationError, "ObjectType keuzes zijn beperkt op basis van CodeRegister."
with self.assertRaises(ValidationError) as error:
self.client.post(url, data)
with self.subTest("doesn'actor_is_wrong_instance"):
with self.assertRaises(ValidationError):
self.client.post(url, data)

def test_invalid_validation_partij_identificator_code_soort_object_id(self):
url = reverse("klantinteracties:partijidentificator-list")
Expand All @@ -2135,8 +2136,9 @@ def test_invalid_validation_partij_identificator_code_soort_object_id(self):
},
}
# "CodeSoortObjectId keuzes zijn beperkt op basis van CodeObjectType.",
with self.assertRaises(ValidationError) as error:
self.client.post(url, data)
with self.subTest("doesn'actor_is_wrong_instance"):
with self.assertRaises(ValidationError):
self.client.post(url, data)

def test_invalid_validation_partij_identificator_object_id(self):
url = reverse("klantinteracties:partijidentificator-list")
Expand All @@ -2152,8 +2154,9 @@ def test_invalid_validation_partij_identificator_object_id(self):
},
}
# "De lengte van de ObjectId moet tussen 8 en 9 liggen."
with self.assertRaises(ValidationError) as error:
self.client.post(url, data)
with self.subTest("doesn'actor_is_wrong_instance"):
with self.assertRaises(ValidationError):
self.client.post(url, data)

def test_valid_validation_partij_identificator(self):
# All validations pass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.core.exceptions import ValidationError
from rest_framework.serializers import ValidationError
from django.utils.translation import gettext_lazy as _

from .constants import (
Expand Down

0 comments on commit e912771

Please sign in to comment.