@@ -5199,6 +5199,115 @@ def test_sharing_api_map_vcf_bday_template(self) -> None:
51995199 }}
52005200 _ , headers , answer = self ._sharing_api_json ("map" , "update" , check = 400 , login = "owner:ownerpw" , json_dict = json_dict )
52015201
5202+ self .configure ({
5203+ "sharing" : {"conversion_bday_description_template" : sharing .SHARING_BDAY_DESCRIPTION_TEMPLATE_DEFAULT ,
5204+ "conversion_bday_alarm_trigger_template" : "" ,
5205+ }
5206+ })
5207+
5208+ # update template
5209+ logging .info ("\n *** update map(bday) user/owner:r with valid description template -> 200" )
5210+ json_dict = {}
5211+ json_dict ['User' ] = "user"
5212+ json_dict ['PathMapped' ] = path_mapped
5213+ json_dict ['PathOrToken' ] = path_shared_r
5214+ json_dict ['Actions' ] = {"config" : {
5215+ "conversion_bday_summary_template" : "{fn} ({year})" ,
5216+ "conversion_bday_description_template" : "Birthday={year}-{month}-{day}"
5217+ }}
5218+ _ , headers , answer = self ._sharing_api_json ("map" , "update" , check = 200 , login = "owner:ownerpw" , json_dict = json_dict )
5219+
5220+ logging .info ("\n *** GET collection user format: description -> ok" )
5221+ _ , headers , answer = self .request ("GET" , path_shared_3 , login = "user:userpw" )
5222+ assert "DESCRIPTION:Birthday=1990-01-01" in answer
5223+ assert "SUMMARY:Test-FN-C3 (1990)" in answer
5224+
5225+ # update template
5226+ logging .info ("\n *** update map(bday) user/owner:r with valid empty description template -> 200" )
5227+ json_dict = {}
5228+ json_dict ['User' ] = "user"
5229+ json_dict ['PathMapped' ] = path_mapped
5230+ json_dict ['PathOrToken' ] = path_shared_r
5231+ json_dict ['Actions' ] = {"config" : {
5232+ "conversion_bday_description_template" : ""
5233+ }}
5234+ _ , headers , answer = self ._sharing_api_json ("map" , "update" , check = 200 , login = "owner:ownerpw" , json_dict = json_dict )
5235+
5236+ logging .info ("\n *** GET collection user format: description -> ok" )
5237+ _ , headers , answer = self .request ("GET" , path_shared_3 , login = "user:userpw" )
5238+ assert "DESCRIPTION:Birthday=" not in answer
5239+ assert "DESCRIPTION:BDAY=" not in answer
5240+ assert "SUMMARY:Test-FN-C3 (1990)" in answer
5241+
5242+ # update template
5243+ logging .info ("\n *** update map(bday) user/owner:r DEL description template -> 200" )
5244+ json_dict = {}
5245+ json_dict ['User' ] = "user"
5246+ json_dict ['PathMapped' ] = path_mapped
5247+ json_dict ['PathOrToken' ] = path_shared_r
5248+ json_dict ['Actions' ] = {"config" : {
5249+ "conversion_bday_description_template" : sharing .SHARING_ACTIONS_DELETE_VALUE
5250+ }}
5251+ _ , headers , answer = self ._sharing_api_json ("map" , "update" , check = 200 , login = "owner:ownerpw" , json_dict = json_dict )
5252+
5253+ logging .info ("\n *** GET collection user format: description -> ok" )
5254+ _ , headers , answer = self .request ("GET" , path_shared_3 , login = "user:userpw" )
5255+ assert "DESCRIPTION:Birthday=" not in answer
5256+ assert "DESCRIPTION:BDAY=" in answer
5257+ assert "SUMMARY:Test-FN-C3 (1990)" in answer
5258+
5259+ # update template
5260+ logging .info ("\n *** update map(bday) user/owner:r DEL summary template -> 200" )
5261+ json_dict = {}
5262+ json_dict ['User' ] = "user"
5263+ json_dict ['PathMapped' ] = path_mapped
5264+ json_dict ['PathOrToken' ] = path_shared_r
5265+ json_dict ['Actions' ] = {"config" : {
5266+ "conversion_bday_summary_template" : sharing .SHARING_ACTIONS_DELETE_VALUE
5267+ }}
5268+ _ , headers , answer = self ._sharing_api_json ("map" , "update" , check = 200 , login = "owner:ownerpw" , json_dict = json_dict )
5269+
5270+ logging .info ("\n *** GET collection user format: description -> ok" )
5271+ _ , headers , answer = self .request ("GET" , path_shared_3 , login = "user:userpw" )
5272+ assert "DESCRIPTION:Birthday=" not in answer
5273+ assert "DESCRIPTION:BDAY=" in answer
5274+ assert "SUMMARY:Family3Test Given3Test !n:a! (Birthday)" in answer
5275+
5276+ # update template
5277+ logging .info ("\n *** update map(bday) user/owner:r with valid age max -> 200" )
5278+ json_dict = {}
5279+ json_dict ['User' ] = "user"
5280+ json_dict ['PathMapped' ] = path_mapped
5281+ json_dict ['PathOrToken' ] = path_shared_r
5282+ json_dict ['Actions' ] = {"config" : {
5283+ "conversion_bday_age_max" : 5 ,
5284+ "conversion_bday_summary_template" : "{fn} ({year}/{age})" ,
5285+ }}
5286+ _ , headers , answer = self ._sharing_api_json ("map" , "update" , check = 200 , login = "owner:ownerpw" , json_dict = json_dict )
5287+
5288+ logging .info ("\n *** GET collection user format: summary with age -> ok" )
5289+ _ , headers , answer = self .request ("GET" , path_shared_3 , login = "user:userpw" )
5290+ assert "Test-FN-C3 (1990/0)" in answer
5291+ assert "Test-FN-C3 (1990/5)" in answer
5292+ assert "Test-FN-C3 (1990/6)" not in answer
5293+
5294+ # update template
5295+ logging .info ("\n *** update map(bday) user/owner:r with valid age max -> 200" )
5296+ json_dict = {}
5297+ json_dict ['User' ] = "user"
5298+ json_dict ['PathMapped' ] = path_mapped
5299+ json_dict ['PathOrToken' ] = path_shared_r
5300+ json_dict ['Actions' ] = {"config" : {
5301+ "conversion_bday_age_max" : sharing .SHARING_ACTIONS_DELETE_VALUE
5302+ }}
5303+ _ , headers , answer = self ._sharing_api_json ("map" , "update" , check = 200 , login = "owner:ownerpw" , json_dict = json_dict )
5304+
5305+ logging .info ("\n *** GET collection user format: summary with age -> ok" )
5306+ _ , headers , answer = self .request ("GET" , path_shared_3 , login = "user:userpw" )
5307+ assert "Test-FN-C3 (1990/0)" in answer
5308+ assert "Test-FN-C3 (1990/5)" in answer
5309+ assert "Test-FN-C3 (1990/6)" in answer
5310+
52025311 def test_sharing_api_map_vcf_bday_age_template (self ) -> None :
52035312 """share-by-map with conversion=bday template tests with age."""
52045313 self .configure ({"auth" : {"type" : "htpasswd" ,
0 commit comments