diff --git a/swh/deposit/tests/api/test_checks.py b/swh/deposit/tests/api/test_checks.py --- a/swh/deposit/tests/api/test_checks.py +++ b/swh/deposit/tests/api/test_checks.py @@ -367,6 +367,84 @@ "fields": ["swh:deposit"], }, ), + ( + f"""\ + + something + something-else + bar + someone + + + + + + + + + + """, + { + "summary": ( + r".*Reason: assertion test if false.*" + r"Schema:\n*" + r' *]+ id="swhdeposit-incompatible-create-and-add".*' + ), + "fields": ["swh:deposit"], + }, + ), + ( + f"""\ + + something + something-else + bar + someone + + + + + + + + + + """, + { + "summary": ( + r".*Reason: assertion test if false.*" + r"Schema:\n*" + r' *]+ id="swhdeposit-incompatible-create-and-reference".*' + ), + "fields": ["swh:deposit"], + }, + ), + ( + f"""\ + + something + something-else + bar + someone + + + + + + + + + + """, + { + "summary": ( + r".*Reason: assertion test if false.*" + r"Schema:\n*" + r' *]+ id="swhdeposit-incompatible-add-and-reference".*' + ), + "fields": ["swh:deposit"], + }, + ), ( f"""\ diff --git a/swh/deposit/xsd/swh.xsd b/swh/deposit/xsd/swh.xsd --- a/swh/deposit/xsd/swh.xsd +++ b/swh/deposit/xsd/swh.xsd @@ -1,5 +1,6 @@ - - @@ -47,6 +45,23 @@ + + + + +