@@ -4444,48 +4444,52 @@ def make_collection_payload(**attributes):
44444444
44454445 def test_switch_inactive_no_cedar_record_submission_succeeds (self , app , user_one , project , url , payload ):
44464446 # Switch off: validation is skipped even if no CEDAR record exists
4447- with override_switch (features .COLLECTION_SUBMISSION_WITH_CEDAR , active = False ):
4448- res = app .post_json_api (
4449- url ,
4450- payload (guid = project ._id ),
4451- auth = user_one .auth ,
4452- )
4447+ with mock_update_share ():
4448+ with override_switch (features .COLLECTION_SUBMISSION_WITH_CEDAR , active = False ):
4449+ res = app .post_json_api (
4450+ url ,
4451+ payload (guid = project ._id ),
4452+ auth = user_one .auth ,
4453+ )
44534454 assert res .status_code == 201
44544455
44554456 def test_switch_active_no_provider_submission_succeeds (self , app , user_one , project , url_no_provider , payload ):
44564457 # Switch on but collection has no provider: validation is skipped
4457- with override_switch (features .COLLECTION_SUBMISSION_WITH_CEDAR , active = True ):
4458- res = app .post_json_api (
4459- url_no_provider ,
4460- payload (guid = project ._id ),
4461- auth = user_one .auth ,
4462- )
4458+ with mock_update_share ():
4459+ with override_switch (features .COLLECTION_SUBMISSION_WITH_CEDAR , active = True ):
4460+ res = app .post_json_api (
4461+ url_no_provider ,
4462+ payload (guid = project ._id ),
4463+ auth = user_one .auth ,
4464+ )
44634465 assert res .status_code == 201
44644466
44654467 def test_switch_active_provider_no_required_template_submission_succeeds (self , app , user_one , project , url , payload , provider ):
44664468 # Switch on but provider has no required_metadata_template set
44674469 provider .required_metadata_template = None
44684470 provider .save ()
4469- with override_switch (features .COLLECTION_SUBMISSION_WITH_CEDAR , active = True ):
4470- res = app .post_json_api (
4471- url ,
4472- payload (guid = project ._id ),
4473- auth = user_one .auth ,
4474- )
4471+ with mock_update_share ():
4472+ with override_switch (features .COLLECTION_SUBMISSION_WITH_CEDAR , active = True ):
4473+ res = app .post_json_api (
4474+ url ,
4475+ payload (guid = project ._id ),
4476+ auth = user_one .auth ,
4477+ )
44754478 assert res .status_code == 201
44764479
44774480 def test_switch_active_with_cedar_record_submission_succeeds (self , app , user_one , project , url , payload , cedar_template ):
44784481 # Switch on, provider has required template, and object has matching CEDAR record
4479- CedarMetadataRecordFactory (
4480- guid = project .guids .first (),
4481- template = cedar_template ,
4482- )
4483- with override_switch (features .COLLECTION_SUBMISSION_WITH_CEDAR , active = True ):
4484- res = app .post_json_api (
4485- url ,
4486- payload (guid = project ._id ),
4487- auth = user_one .auth ,
4482+ with mock_update_share ():
4483+ CedarMetadataRecordFactory (
4484+ guid = project .guids .first (),
4485+ template = cedar_template ,
44884486 )
4487+ with override_switch (features .COLLECTION_SUBMISSION_WITH_CEDAR , active = True ):
4488+ res = app .post_json_api (
4489+ url ,
4490+ payload (guid = project ._id ),
4491+ auth = user_one .auth ,
4492+ )
44894493 assert res .status_code == 201
44904494
44914495 def test_switch_active_missing_cedar_record_submission_fails (self , app , user_one , project , url , payload ):
0 commit comments