18
18
19
19
class PartijIdentificatorTypesValidatorTests (TestCase ):
20
20
def test_valid (self ):
21
- validator = PartijIdentificatorTypesValidator (
21
+ PartijIdentificatorTypesValidator (
22
22
partij_identificator = {
23
23
"code_objecttype" : PartijIdentificatorCodeObjectType .natuurlijk_persoon .value ,
24
24
"code_soort_object_id" : PartijIdentificatorCodeSoortObjectId .bsn .value ,
25
25
"object_id" : "296648875" ,
26
26
"code_register" : PartijIdentificatorCodeRegister .brp .value ,
27
27
}
28
- )
29
- validator .validate ()
28
+ )()
30
29
31
30
# Start section validate_code_objecttype
32
31
@@ -325,15 +324,14 @@ def test_allowed_cases(self):
325
324
],
326
325
]
327
326
for case in valid_cases :
328
- validator = PartijIdentificatorTypesValidator (
327
+ PartijIdentificatorTypesValidator (
329
328
partij_identificator = {
330
329
"code_register" : case [0 ],
331
330
"code_objecttype" : case [1 ],
332
331
"code_soort_object_id" : case [2 ],
333
332
"object_id" : case [3 ],
334
333
},
335
- )
336
- validator .validate ()
334
+ )()
337
335
338
336
def test_not_allowed_cases (self ):
339
337
invalid_cases = [
@@ -358,15 +356,14 @@ def test_not_allowed_cases(self):
358
356
]
359
357
for case in invalid_cases :
360
358
with self .assertRaises (ValidationError ):
361
- validator = PartijIdentificatorTypesValidator (
359
+ PartijIdentificatorTypesValidator (
362
360
partij_identificator = {
363
361
"code_register" : case [0 ],
364
362
"code_objecttype" : case [1 ],
365
363
"code_soort_object_id" : case [2 ],
366
364
"object_id" : case [3 ],
367
365
}
368
- )
369
- validator .validate ()
366
+ )()
370
367
371
368
372
369
class PartijIdentificatorUniquenessValidatorTests (TestCase ):
@@ -381,7 +378,7 @@ def test_valid_global_uniqueness(self):
381
378
},
382
379
sub_identificator_van = None ,
383
380
instance = None ,
384
- ). validate ()
381
+ )()
385
382
386
383
def test_valid_relation_sub_identificator_van (self ):
387
384
# check self relation and sub_identificator_van allowed cases
@@ -403,7 +400,7 @@ def test_valid_relation_sub_identificator_van(self):
403
400
sub_identificator_van = sub_identificator_van ,
404
401
instance = None ,
405
402
partij = partij ,
406
- ). validate ()
403
+ )()
407
404
408
405
def test_invalid_self_relation_sub_identificator_van (self ):
409
406
partij_identificator = PartijIdentificatorFactory .create (
@@ -422,12 +419,12 @@ def test_invalid_self_relation_sub_identificator_van(self):
422
419
},
423
420
sub_identificator_van = partij_identificator ,
424
421
instance = partij_identificator ,
425
- ). validate ()
422
+ )()
426
423
427
424
details = error .exception .message_dict
428
425
self .assertEqual (
429
426
details ["sub_identificator_van" ][0 ],
430
- "Kan zichzelf niet selecteren als `sub_identificator_van `." ,
427
+ "Kan zichzelf niet selecteren als `subIdentificatorVan `." ,
431
428
)
432
429
433
430
def test_invalid_sub_identificator_van_type_not_allowed (self ):
@@ -448,7 +445,7 @@ def test_invalid_sub_identificator_van_type_not_allowed(self):
448
445
},
449
446
sub_identificator_van = sub_identificator_van ,
450
447
instance = None ,
451
- ). validate ()
448
+ )()
452
449
453
450
details = error .exception .message_dict
454
451
self .assertEqual (
@@ -469,10 +466,10 @@ def test_invalid_partij_identificator_vestigingsnummer_require_sub_identificator
469
466
},
470
467
sub_identificator_van = None ,
471
468
instance = None ,
472
- ). validate ()
469
+ )()
473
470
474
471
details = error .exception .message_dict
475
472
self .assertTrue (
476
- "`sub_identifier_van` met CodeSoortObjectId = `kvk_nummer` te kiezen."
473
+ "`sub_identifier_van` met codeSoortObjectId = `kvk_nummer` te kiezen."
477
474
in details ["sub_identificator_van" ][0 ]
478
475
)
0 commit comments