@@ -1024,6 +1024,105 @@ def test_update_partij(self):
1024
1024
},
1025
1025
)
1026
1026
1027
+ def test_update_partij_partijidentificator_empty_list (self ):
1028
+ partij = PartijFactory .create (
1029
+ nummer = "1298329191" ,
1030
+ interne_notitie = "interneNotitie" ,
1031
+ voorkeurs_digitaal_adres = None ,
1032
+ voorkeurs_rekeningnummer = None ,
1033
+ soort_partij = "persoon" ,
1034
+ indicatie_geheimhouding = True ,
1035
+ voorkeurstaal = "ndl" ,
1036
+ indicatie_actief = True ,
1037
+ bezoekadres_nummeraanduiding_id = "095be615-a8ad-4c33-8e9c-c7612fbf6c9f" ,
1038
+ bezoekadres_adresregel1 = "adres1" ,
1039
+ bezoekadres_adresregel2 = "adres2" ,
1040
+ bezoekadres_adresregel3 = "adres3" ,
1041
+ bezoekadres_land = "6030" ,
1042
+ correspondentieadres_nummeraanduiding_id = "095be615-a8ad-4c33-8e9c-c7612fbf6c9f" ,
1043
+ correspondentieadres_adresregel1 = "adres1" ,
1044
+ correspondentieadres_adresregel2 = "adres2" ,
1045
+ correspondentieadres_adresregel3 = "adres3" ,
1046
+ correspondentieadres_land = "6030" ,
1047
+ )
1048
+ PersoonFactory .create (
1049
+ partij = partij ,
1050
+ contactnaam_voorletters = "P" ,
1051
+ contactnaam_voornaam = "Phil" ,
1052
+ contactnaam_voorvoegsel_achternaam = "" ,
1053
+ contactnaam_achternaam = "Bozeman" ,
1054
+ )
1055
+
1056
+ digitaal_adres2 = DigitaalAdresFactory .create ()
1057
+ rekeningnummer2 = RekeningnummerFactory .create ()
1058
+
1059
+ partij_identificator = PartijIdentificatorFactory .create (
1060
+ partij = partij ,
1061
+ partij_identificator_code_objecttype = "natuurlijk_persoon" ,
1062
+ partij_identificator_code_soort_object_id = "bsn" ,
1063
+ partij_identificator_object_id = "296648875" ,
1064
+ partij_identificator_code_register = "brp" ,
1065
+ )
1066
+
1067
+ detail_url = reverse (
1068
+ "klantinteracties:partij-detail" , kwargs = {"uuid" : str (partij .uuid )}
1069
+ )
1070
+ response = self .client .get (detail_url )
1071
+ data = response .json ()
1072
+ self .assertEqual (partij .partijidentificator_set .all ().count (), 1 )
1073
+ self .assertEqual (
1074
+ data ["partijIdentificatoren" ][0 ]["partijIdentificator" ],
1075
+ {
1076
+ "codeObjecttype" : partij_identificator .partij_identificator_code_objecttype ,
1077
+ "codeSoortObjectId" : partij_identificator .partij_identificator_code_soort_object_id ,
1078
+ "objectId" : partij_identificator .partij_identificator_object_id ,
1079
+ "codeRegister" : partij_identificator .partij_identificator_code_register ,
1080
+ },
1081
+ )
1082
+
1083
+ data = {
1084
+ "nummer" : "6427834668" ,
1085
+ "interneNotitie" : "changed" ,
1086
+ "digitaleAdressen" : [{"uuid" : str (digitaal_adres2 .uuid )}],
1087
+ "voorkeursDigitaalAdres" : {"uuid" : str (digitaal_adres2 .uuid )},
1088
+ "rekeningnummers" : [{"uuid" : str (rekeningnummer2 .uuid )}],
1089
+ "voorkeursRekeningnummer" : {"uuid" : str (rekeningnummer2 .uuid )},
1090
+ "soortPartij" : "persoon" ,
1091
+ "indicatieGeheimhouding" : None ,
1092
+ "voorkeurstaal" : "ger" ,
1093
+ "indicatieActief" : False ,
1094
+ "bezoekadres" : {
1095
+ "nummeraanduidingId" : "f78sd8f-uh45-34km-2o3n-aasdasdasc9g" ,
1096
+ "adresregel1" : "changed" ,
1097
+ "adresregel2" : "changed" ,
1098
+ "adresregel3" : "changed" ,
1099
+ "land" : "3060" ,
1100
+ },
1101
+ "correspondentieadres" : {
1102
+ "nummeraanduidingId" : "sd76f7sd-j4nr-a9s8-83ec-sad89f79a7sd" ,
1103
+ "adresregel1" : "changed" ,
1104
+ "adresregel2" : "changed" ,
1105
+ "adresregel3" : "changed" ,
1106
+ "land" : "3060" ,
1107
+ },
1108
+ "partijIdentificatie" : {
1109
+ "contactnaam" : {
1110
+ "voorletters" : "V" ,
1111
+ "voornaam" : "Vincent" ,
1112
+ "voorvoegselAchternaam" : "" ,
1113
+ "achternaam" : "Bennette" ,
1114
+ }
1115
+ },
1116
+ "partijIdentificatoren" : [],
1117
+ }
1118
+
1119
+ response = self .client .put (detail_url , data )
1120
+ self .assertEqual (response .status_code , status .HTTP_200_OK )
1121
+ data = response .json ()
1122
+
1123
+ self .assertEqual (len (data ["partijIdentificatoren" ]), 0 )
1124
+ self .assertEqual (partij .partijidentificator_set .all ().count (), 0 )
1125
+
1027
1126
def test_update_partij_persoon (self ):
1028
1127
partij = PartijFactory .create (
1029
1128
nummer = "1298329191" ,
0 commit comments