deposit_collection = <DepositCollection: {'id': 97, 'name': 'test'}>
authenticated_client = <rest_framework.test.APIClient object at 0x7f2d3c03bcf8>
atom_dataset = {'codemeta-sample': '<?xml version="1.0"?>\n <entry xmlns="http://www.w3.org/2005/Atom"\n xmlns:d...ntry>\n', 'entry-data-empty-body': '<?xml version="1.0"?>\n<entry xmlns="http://www.w3.org/2005/Atom"></entry>\n', ...}
def test_add_metadata_to_unknown_deposit(
deposit_collection, authenticated_client, atom_dataset
):
"""Replacing metadata to unknown deposit should return a 404 response
"""
unknown_deposit_id = 1000
try:
Deposit.objects.get(pk=unknown_deposit_id)
except Deposit.DoesNotExist:
assert True
url = reverse(SE_IRI, args=[deposit_collection, unknown_deposit_id])
response = authenticated_client.post(
url,
content_type="application/atom+xml;type=entry",
data=atom_dataset["entry-data1"],
)
assert response.status_code == status.HTTP_404_NOT_FOUND
response_content = parse_xml(response.content)
> assert "Unknown collection name" in response_content["sword:error"]["atom:summary"]
E KeyError: 'atom:summary'
.tox/py3/lib/python3.7/site-packages/swh/deposit/tests/api/test_deposit_update.py:365: KeyError
TEST RESULT
TEST RESULT
- Run At
- Nov 20 2020, 3:55 PM