@@ -2148,12 +2148,9 @@ def _get_detail_url(partij: Partij) -> str:
2148
2148
2149
2149
def test_get_partij_and_partij_identificatoren (self ):
2150
2150
partij = PartijFactory .create ()
2151
- partij_identificator = PartijIdentificatorFactory .create (
2151
+ partij_identificator = BsnPartijIdentificatorFactory .create (
2152
2152
partij = partij ,
2153
- partij_identificator_code_objecttype = "natuurlijk_persoon" ,
2154
- partij_identificator_code_soort_object_id = "bsn" ,
2155
2153
partij_identificator_object_id = "296648875" ,
2156
- partij_identificator_code_register = "brp" ,
2157
2154
)
2158
2155
detail_url = reverse (
2159
2156
"klantinteracties:partij-detail" , kwargs = {"uuid" : str (partij .uuid )}
@@ -2417,13 +2414,9 @@ def test_create_partij_identificator(self):
2417
2414
2418
2415
def test_update_partij_identificator (self ):
2419
2416
partij , partij2 = PartijFactory .create_batch (2 )
2420
- partij_identificator = PartijIdentificatorFactory .create (
2417
+ partij_identificator = BsnPartijIdentificatorFactory .create (
2421
2418
partij = partij ,
2422
- andere_partij_identificator = "anderePartijIdentificator" ,
2423
- partij_identificator_code_objecttype = "natuurlijk_persoon" ,
2424
- partij_identificator_code_soort_object_id = "bsn" ,
2425
2419
partij_identificator_object_id = "296648875" ,
2426
- partij_identificator_code_register = "brp" ,
2427
2420
)
2428
2421
2429
2422
detail_url = reverse (
@@ -2474,13 +2467,10 @@ def test_update_partij_identificator(self):
2474
2467
2475
2468
def test_partial_update_partij_identificator (self ):
2476
2469
partij = PartijFactory .create ()
2477
- partij_identificator = PartijIdentificatorFactory .create (
2470
+ partij_identificator = BsnPartijIdentificatorFactory .create (
2478
2471
partij = partij ,
2479
2472
andere_partij_identificator = "anderePartijIdentificator" ,
2480
- partij_identificator_code_objecttype = "natuurlijk_persoon" ,
2481
- partij_identificator_code_soort_object_id = "bsn" ,
2482
2473
partij_identificator_object_id = "296648875" ,
2483
- partij_identificator_code_register = "brp" ,
2484
2474
)
2485
2475
2486
2476
detail_url = reverse (
@@ -2676,13 +2666,10 @@ def test_invalid_update_partial(self):
2676
2666
# all partij_identificator fields required
2677
2667
partij = PartijFactory .create ()
2678
2668
list_url = reverse ("klantinteracties:partijidentificator-list" )
2679
- partij_identificator = PartijIdentificatorFactory .create (
2669
+ partij_identificator = BsnPartijIdentificatorFactory .create (
2680
2670
partij = partij ,
2681
2671
andere_partij_identificator = "anderePartijIdentificator" ,
2682
- partij_identificator_code_objecttype = "natuurlijk_persoon" ,
2683
- partij_identificator_code_soort_object_id = "bsn" ,
2684
2672
partij_identificator_object_id = "123456782" ,
2685
- partij_identificator_code_register = "brp" ,
2686
2673
)
2687
2674
2688
2675
data = {
@@ -2732,13 +2719,10 @@ def test_valid_create(self):
2732
2719
self .assertEqual (PartijIdentificator .objects .all ().count (), 1 )
2733
2720
2734
2721
def test_valid_create_with_sub_identificator_van (self ):
2735
- partij_identificator = PartijIdentificatorFactory .create (
2722
+ partij_identificator = KvkNummerPartijIdentificatorFactory .create (
2736
2723
partij = self .partij ,
2737
2724
andere_partij_identificator = "anderePartijIdentificator" ,
2738
- partij_identificator_code_objecttype = "niet_natuurlijk_persoon" ,
2739
- partij_identificator_code_soort_object_id = "kvk_nummer" ,
2740
2725
partij_identificator_object_id = "12345678" ,
2741
- partij_identificator_code_register = "hr" ,
2742
2726
)
2743
2727
data = {
2744
2728
"identificeerdePartij" : {"uuid" : str (self .partij .uuid )},
@@ -2770,9 +2754,9 @@ def test_invalid_create_partij_required(self):
2770
2754
self .assertEqual (error ["reason" ], "Dit veld is vereist." )
2771
2755
2772
2756
def test_invalid_create_duplicate_code_soort_object_id_for_partij (self ):
2773
- PartijIdentificatorFactory .create (
2757
+ BsnPartijIdentificatorFactory .create (
2774
2758
partij = self .partij ,
2775
- partij_identificator_code_soort_object_id = "bsn " ,
2759
+ partij_identificator_object_id = "296648875 " ,
2776
2760
)
2777
2761
2778
2762
data = {
@@ -2794,13 +2778,10 @@ def test_invalid_create_duplicate_code_soort_object_id_for_partij(self):
2794
2778
)
2795
2779
2796
2780
def test_valid_update_partij (self ):
2797
- partij_identificator = PartijIdentificatorFactory .create (
2781
+ partij_identificator = BsnPartijIdentificatorFactory .create (
2798
2782
partij = PartijFactory .create (),
2799
2783
andere_partij_identificator = "anderePartijIdentificator" ,
2800
- partij_identificator_code_objecttype = "natuurlijk_persoon" ,
2801
- partij_identificator_code_soort_object_id = "bsn" ,
2802
2784
partij_identificator_object_id = "123456782" ,
2803
- partij_identificator_code_register = "brp" ,
2804
2785
)
2805
2786
data = {
2806
2787
"identificeerdePartij" : {"uuid" : str (self .partij .uuid )},
@@ -2819,22 +2800,15 @@ def test_valid_update_partij(self):
2819
2800
2820
2801
def test_invalid_update_partij (self ):
2821
2802
new_partij = PartijFactory .create ()
2822
- PartijIdentificatorFactory .create (
2803
+ BsnPartijIdentificatorFactory .create (
2823
2804
partij = new_partij ,
2824
2805
andere_partij_identificator = "anderePartijIdentificator" ,
2825
- partij_identificator_code_objecttype = "natuurlijk_persoon" ,
2826
- partij_identificator_code_soort_object_id = "bsn" ,
2827
2806
partij_identificator_object_id = "123456782" ,
2828
- partij_identificator_code_register = "brp" ,
2829
2807
)
2830
-
2831
- partij_identificator = PartijIdentificatorFactory .create (
2808
+ partij_identificator = BsnPartijIdentificatorFactory .create (
2832
2809
partij = self .partij ,
2833
2810
andere_partij_identificator = "anderePartijIdentificator" ,
2834
- partij_identificator_code_objecttype = "natuurlijk_persoon" ,
2835
- partij_identificator_code_soort_object_id = "bsn" ,
2836
2811
partij_identificator_object_id = "296648875" ,
2837
- partij_identificator_code_register = "brp" ,
2838
2812
)
2839
2813
data = {
2840
2814
"identificeerdePartij" : {"uuid" : str (new_partij .uuid )},
@@ -2871,15 +2845,11 @@ def test_invalid_update_partij(self):
2871
2845
)
2872
2846
2873
2847
def test_valid_update_check_uniqueness_values (self ):
2874
- partij_identificator = PartijIdentificatorFactory .create (
2848
+ partij_identificator = BsnPartijIdentificatorFactory .create (
2875
2849
partij = self .partij ,
2876
2850
andere_partij_identificator = "anderePartijIdentificator" ,
2877
- partij_identificator_code_objecttype = "natuurlijk_persoon" ,
2878
- partij_identificator_code_soort_object_id = "bsn" ,
2879
2851
partij_identificator_object_id = "123456782" ,
2880
- partij_identificator_code_register = "brp" ,
2881
2852
)
2882
-
2883
2853
data = {
2884
2854
"identificeerdePartij" : {"uuid" : str (self .partij .uuid )},
2885
2855
"anderePartijIdentificator" : "changed" ,
@@ -2911,20 +2881,13 @@ def test_valid_update_check_uniqueness_values(self):
2911
2881
)
2912
2882
2913
2883
def test_invalid_update_check_uniqueness_exists (self ):
2914
- partij_identificator_a = PartijIdentificatorFactory .create (
2884
+ partij_identificator_a = BsnPartijIdentificatorFactory .create (
2915
2885
partij = self .partij ,
2916
- partij_identificator_code_objecttype = "natuurlijk_persoon" ,
2917
- partij_identificator_code_soort_object_id = "bsn" ,
2918
2886
partij_identificator_object_id = "123456782" ,
2919
- partij_identificator_code_register = "brp" ,
2920
2887
)
2921
-
2922
- partij_identificator_b = PartijIdentificatorFactory .create (
2888
+ partij_identificator_b = BsnPartijIdentificatorFactory .create (
2923
2889
partij = PartijFactory .create (),
2924
- partij_identificator_code_objecttype = "natuurlijk_persoon" ,
2925
- partij_identificator_code_soort_object_id = "bsn" ,
2926
2890
partij_identificator_object_id = "296648875" ,
2927
- partij_identificator_code_register = "brp" ,
2928
2891
)
2929
2892
# update partij_identificator_a with partij_identificator_b data
2930
2893
detail_url = reverse (
@@ -2953,21 +2916,15 @@ def test_invalid_update_check_uniqueness_exists(self):
2953
2916
)
2954
2917
2955
2918
def test_valid_check_uniqueness_sub_identificator_van (self ):
2956
- PartijIdentificatorFactory .create (
2919
+ BsnPartijIdentificatorFactory .create (
2957
2920
partij = self .partij ,
2958
- partij_identificator_code_objecttype = "natuurlijk_persoon" ,
2959
- partij_identificator_code_soort_object_id = "bsn" ,
2960
2921
partij_identificator_object_id = "296648875" ,
2961
- partij_identificator_code_register = "brp" ,
2962
2922
)
2963
2923
# Same values, but sub_identifier_van is set
2964
2924
partij = PartijFactory .create ()
2965
- sub_identificator_van = PartijIdentificatorFactory .create (
2925
+ sub_identificator_van = KvkNummerPartijIdentificatorFactory .create (
2966
2926
partij = partij ,
2967
- partij_identificator_code_objecttype = "niet_natuurlijk_persoon" ,
2968
- partij_identificator_code_soort_object_id = "kvk_nummer" ,
2969
2927
partij_identificator_object_id = "12345678" ,
2970
- partij_identificator_code_register = "hr" ,
2971
2928
)
2972
2929
self .assertEqual (PartijIdentificator .objects .all ().count (), 2 )
2973
2930
data = {
@@ -2985,20 +2942,14 @@ def test_valid_check_uniqueness_sub_identificator_van(self):
2985
2942
self .assertEqual (PartijIdentificator .objects .all ().count (), 3 )
2986
2943
2987
2944
def test_invalid_check_uniqueness_sub_identificator_van (self ):
2988
- sub_identificator_van = PartijIdentificatorFactory .create (
2945
+ sub_identificator_van = KvkNummerPartijIdentificatorFactory .create (
2989
2946
partij = self .partij ,
2990
- partij_identificator_code_objecttype = "niet_natuurlijk_persoon" ,
2991
- partij_identificator_code_soort_object_id = "kvk_nummer" ,
2992
2947
partij_identificator_object_id = "12345678" ,
2993
- partij_identificator_code_register = "hr" ,
2994
2948
)
2995
- PartijIdentificatorFactory .create (
2949
+ BsnPartijIdentificatorFactory .create (
2996
2950
partij = self .partij ,
2997
2951
sub_identificator_van = sub_identificator_van ,
2998
- partij_identificator_code_objecttype = "natuurlijk_persoon" ,
2999
- partij_identificator_code_soort_object_id = "bsn" ,
3000
2952
partij_identificator_object_id = "296648875" ,
3001
- partij_identificator_code_register = "brp" ,
3002
2953
)
3003
2954
self .assertEqual (PartijIdentificator .objects .all ().count (), 2 )
3004
2955
# Same values and same sub_identificator_van
@@ -3023,12 +2974,9 @@ def test_invalid_check_uniqueness_sub_identificator_van(self):
3023
2974
self .assertEqual (PartijIdentificator .objects .all ().count (), 2 )
3024
2975
3025
2976
def test_vestigingsnummer_valid_create (self ):
3026
- sub_identificator_van = PartijIdentificatorFactory .create (
2977
+ sub_identificator_van = KvkNummerPartijIdentificatorFactory .create (
3027
2978
partij = self .partij ,
3028
- partij_identificator_code_objecttype = "niet_natuurlijk_persoon" ,
3029
- partij_identificator_code_soort_object_id = "kvk_nummer" ,
3030
2979
partij_identificator_object_id = "12345678" ,
3031
- partij_identificator_code_register = "hr" ,
3032
2980
)
3033
2981
3034
2982
data = {
@@ -3072,12 +3020,9 @@ def test_vestigingsnummer_invalid_create_without_sub_identificator_van(self):
3072
3020
)
3073
3021
3074
3022
def test_vestigingsnummer_invalid_create_without_partij (self ):
3075
- sub_identificator_van = PartijIdentificatorFactory .create (
3023
+ sub_identificator_van = KvkNummerPartijIdentificatorFactory .create (
3076
3024
partij = self .partij ,
3077
- partij_identificator_code_objecttype = "niet_natuurlijk_persoon" ,
3078
- partij_identificator_code_soort_object_id = "kvk_nummer" ,
3079
3025
partij_identificator_object_id = "12345678" ,
3080
- partij_identificator_code_register = "hr" ,
3081
3026
)
3082
3027
3083
3028
data = {
@@ -3098,12 +3043,9 @@ def test_vestigingsnummer_invalid_create_without_partij(self):
3098
3043
3099
3044
def test_vestigingsnummer_valid_create_external_partij (self ):
3100
3045
partij = PartijFactory .create ()
3101
- sub_identificator_van = PartijIdentificatorFactory .create (
3046
+ sub_identificator_van = KvkNummerPartijIdentificatorFactory .create (
3102
3047
partij = partij ,
3103
- partij_identificator_code_objecttype = "niet_natuurlijk_persoon" ,
3104
- partij_identificator_code_soort_object_id = "kvk_nummer" ,
3105
3048
partij_identificator_object_id = "12345678" ,
3106
- partij_identificator_code_register = "hr" ,
3107
3049
)
3108
3050
3109
3051
# sub_identificator_van partij is different from vestigingsnummer partij
@@ -3122,13 +3064,11 @@ def test_vestigingsnummer_valid_create_external_partij(self):
3122
3064
self .assertEqual (PartijIdentificator .objects .all ().count (), 2 )
3123
3065
3124
3066
def test_vestigingsnummer_invalid_create_invalid_sub_identificator_van (self ):
3125
- sub_identificator_van = PartijIdentificatorFactory .create (
3067
+ sub_identificator_van = BsnPartijIdentificatorFactory .create (
3126
3068
partij = self .partij ,
3127
- partij_identificator_code_objecttype = "natuurlijk_persoon" ,
3128
- partij_identificator_code_soort_object_id = "bsn" ,
3129
3069
partij_identificator_object_id = "296648875" ,
3130
- partij_identificator_code_register = "brp" ,
3131
3070
)
3071
+
3132
3072
data = {
3133
3073
"identificeerdePartij" : {"uuid" : str (self .partij .uuid )},
3134
3074
"sub_identificator_van" : {"uuid" : str (sub_identificator_van .uuid )},
@@ -3150,20 +3090,14 @@ def test_vestigingsnummer_invalid_create_invalid_sub_identificator_van(self):
3150
3090
)
3151
3091
3152
3092
def test_vestigingsnummer_valid_update (self ):
3153
- sub_identificator_van = PartijIdentificatorFactory .create (
3093
+ sub_identificator_van = KvkNummerPartijIdentificatorFactory .create (
3154
3094
partij = self .partij ,
3155
- partij_identificator_code_objecttype = "niet_natuurlijk_persoon" ,
3156
- partij_identificator_code_soort_object_id = "kvk_nummer" ,
3157
3095
partij_identificator_object_id = "12345678" ,
3158
- partij_identificator_code_register = "hr" ,
3159
3096
)
3160
- partij_identificator = PartijIdentificatorFactory .create (
3097
+ partij_identificator = VestigingsnummerPartijIdentificatorFactory .create (
3161
3098
partij = self .partij ,
3162
3099
sub_identificator_van = sub_identificator_van ,
3163
- partij_identificator_code_objecttype = "vestiging" ,
3164
- partij_identificator_code_soort_object_id = "vestigingsnummer" ,
3165
3100
partij_identificator_object_id = "111122223333" ,
3166
- partij_identificator_code_register = "hr" ,
3167
3101
)
3168
3102
3169
3103
self .assertEqual (PartijIdentificator .objects .count (), 2 )
@@ -3192,20 +3126,14 @@ def test_vestigingsnummer_valid_update(self):
3192
3126
)
3193
3127
3194
3128
def test_vestigingsnummer_invalid_update_set_sub_identificator_van_null (self ):
3195
- sub_identificator_van = PartijIdentificatorFactory .create (
3129
+ sub_identificator_van = KvkNummerPartijIdentificatorFactory .create (
3196
3130
partij = self .partij ,
3197
- partij_identificator_code_objecttype = "niet_natuurlijk_persoon" ,
3198
- partij_identificator_code_soort_object_id = "kvk_nummer" ,
3199
3131
partij_identificator_object_id = "12345678" ,
3200
- partij_identificator_code_register = "hr" ,
3201
3132
)
3202
- partij_identificator = PartijIdentificatorFactory .create (
3133
+ partij_identificator = VestigingsnummerPartijIdentificatorFactory .create (
3203
3134
partij = self .partij ,
3204
3135
sub_identificator_van = sub_identificator_van ,
3205
- partij_identificator_code_objecttype = "vestiging" ,
3206
- partij_identificator_code_soort_object_id = "vestigingsnummer" ,
3207
3136
partij_identificator_object_id = "111122223333" ,
3208
- partij_identificator_code_register = "hr" ,
3209
3137
)
3210
3138
3211
3139
self .assertEqual (PartijIdentificator .objects .count (), 2 )
@@ -3231,20 +3159,14 @@ def test_vestigingsnummer_invalid_update_set_sub_identificator_van_null(self):
3231
3159
)
3232
3160
3233
3161
def test_invalid_vestigingsnummer_and_kvk_nummer_combination_unique (self ):
3234
- sub_identificator_van = PartijIdentificatorFactory .create (
3162
+ sub_identificator_van = KvkNummerPartijIdentificatorFactory .create (
3235
3163
partij = self .partij ,
3236
- partij_identificator_code_objecttype = "niet_natuurlijk_persoon" ,
3237
- partij_identificator_code_soort_object_id = "kvk_nummer" ,
3238
3164
partij_identificator_object_id = "12345678" ,
3239
- partij_identificator_code_register = "hr" ,
3240
3165
)
3241
- PartijIdentificatorFactory .create (
3166
+ VestigingsnummerPartijIdentificatorFactory .create (
3242
3167
partij = self .partij ,
3243
3168
sub_identificator_van = sub_identificator_van ,
3244
- partij_identificator_code_objecttype = "vestiging" ,
3245
- partij_identificator_code_soort_object_id = "vestigingsnummer" ,
3246
3169
partij_identificator_object_id = "296648875154" ,
3247
- partij_identificator_code_register = "hr" ,
3248
3170
)
3249
3171
# Same sub_identificator_van and same data_values
3250
3172
data = {
@@ -3273,12 +3195,9 @@ def test_invalid_vestigingsnummer_and_kvk_nummer_combination_unique(self):
3273
3195
)
3274
3196
3275
3197
def test_valid_protect_delete (self ):
3276
- partij_identificator = PartijIdentificatorFactory .create (
3198
+ partij_identificator = KvkNummerPartijIdentificatorFactory .create (
3277
3199
partij = self .partij ,
3278
- partij_identificator_code_objecttype = "niet_natuurlijk_persoon" ,
3279
- partij_identificator_code_soort_object_id = "kvk_nummer" ,
3280
3200
partij_identificator_object_id = "12345678" ,
3281
- partij_identificator_code_register = "hr" ,
3282
3201
)
3283
3202
detail_url = reverse (
3284
3203
"klantinteracties:partijidentificator-detail" ,
@@ -3290,20 +3209,14 @@ def test_valid_protect_delete(self):
3290
3209
self .assertEqual (PartijIdentificator .objects .all ().count (), 0 )
3291
3210
3292
3211
def test_invalid_protect_delete (self ):
3293
- sub_identificator_van = PartijIdentificatorFactory .create (
3212
+ sub_identificator_van = KvkNummerPartijIdentificatorFactory .create (
3294
3213
partij = self .partij ,
3295
- partij_identificator_code_objecttype = "niet_natuurlijk_persoon" ,
3296
- partij_identificator_code_soort_object_id = "kvk_nummer" ,
3297
3214
partij_identificator_object_id = "12345678" ,
3298
- partij_identificator_code_register = "hr" ,
3299
3215
)
3300
- PartijIdentificatorFactory .create (
3216
+ VestigingsnummerPartijIdentificatorFactory .create (
3301
3217
partij = self .partij ,
3302
3218
sub_identificator_van = sub_identificator_van ,
3303
- partij_identificator_code_objecttype = "vestiging" ,
3304
- partij_identificator_code_soort_object_id = "vestigingsnummer" ,
3305
3219
partij_identificator_object_id = "296648875154" ,
3306
- partij_identificator_code_register = "hr" ,
3307
3220
)
3308
3221
detail_url = reverse (
3309
3222
"klantinteracties:partijidentificator-detail" ,
0 commit comments