@@ -370,6 +370,9 @@ def test_per_field_permissions_update_draft(
370370 ),
371371 None ,
372372 )
373+ running_app .app .logger .info (f"match: { match } " )
374+ running_app .app .logger .info (f"error: { error } " )
375+ running_app .app .logger .info (f"updated_draft: { updated_draft .get ('errors' )} " )
373376 assert match is not None
374377 assert match == error
375378
@@ -412,31 +415,31 @@ def expected(self) -> dict: # noqa: D102
412415 "changed" : {},
413416 "errors" : [
414417 {
415- "field" : "access| embargo| reason" ,
418+ "field" : "access. embargo. reason" ,
416419 "messages" : [
417420 "You do not have permission to edit this field because the "
418421 "record is included in the test-community community. Please "
419422 "contact the community owner or manager for assistance."
420423 ],
421424 },
422425 {
423- "field" : "access| embargo| active" ,
426+ "field" : "access. embargo. active" ,
424427 "messages" : [
425428 "You do not have permission to edit this field because the "
426429 "record is included in the test-community community. Please "
427430 "contact the community owner or manager for assistance."
428431 ],
429432 },
430433 {
431- "field" : "access| files" ,
434+ "field" : "access. files" ,
432435 "messages" : [
433436 "You do not have permission to edit this field because the "
434437 "record is included in the test-community community. Please "
435438 "contact the community owner or manager for assistance."
436439 ],
437440 },
438441 {
439- "field" : "access| embargo| until" ,
442+ "field" : "access. embargo. until" ,
440443 "messages" : [
441444 "You do not have permission to edit this field because the "
442445 "record is included in the test-community community. Please "
@@ -486,7 +489,7 @@ def expected(self) -> dict: # noqa: D102
486489 },
487490 "errors" : [
488491 {
489- "field" : "metadata| title" ,
492+ "field" : "metadata. title" ,
490493 "messages" : [
491494 "You do not have permission to edit this field "
492495 "because the record is included in the test-community "
@@ -682,7 +685,7 @@ def expected(self) -> dict: # noqa: D102
682685 },
683686 "errors" : [
684687 {
685- "field" : "metadata| funding|2| award| identifiers|0| identifier" ,
688+ "field" : "metadata. funding.2. award. identifiers.0. identifier" ,
686689 "messages" : [
687690 "You do not have permission to edit this field "
688691 "because the record is included in the test-community "
@@ -691,7 +694,7 @@ def expected(self) -> dict: # noqa: D102
691694 ],
692695 },
693696 {
694- "field" : "metadata| funding|0| funder| id" ,
697+ "field" : "metadata. funding.0. funder. id" ,
695698 "messages" : [
696699 "You do not have permission to edit this field "
697700 "because the record is included in the test-community "
@@ -909,7 +912,7 @@ def expected(self) -> dict: # noqa: D102
909912 {
910913 "field" : "parent.communities.default" ,
911914 "message" : (
912- "You do not have permission to remove this collection: "
915+ "You do not have permission to remove this work from "
913916 "XXXX. Please contact the collection owner or "
914917 "manager for assistance."
915918 ),
@@ -954,14 +957,14 @@ def test_remove_from_community(
954957 identity , id_ = record .id , data = {"communities" : [{"id" : community .id }]}
955958 )
956959 assert processed == [
957- {"community" : p .replace ("XXXX" , community .title )}
960+ {"community" : p .replace ("XXXX" , community .id )}
958961 for p in self .expected ["processed" ]
959962 ]
960963 assert len (errors ) == len (self .expected ["errors" ])
961964 if len (errors ) > 0 :
962965 assert errors [0 ]["message" ] == self .expected ["errors" ][0 ][
963966 "message"
964- ].replace ("XXXX" , community .title )
967+ ].replace ("XXXX" , community .to_dict ()[ "metadata" ][ " title" ] )
965968 assert errors [0 ]["field" ] == self .expected ["errors" ][0 ]["field" ]
966969
967970 # Update result object
0 commit comments