Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/tests/api/test_deposit_update.py
Show First 20 Lines • Show All 757 Lines • ▼ Show 20 Lines | """failure: client updates metadata on deposit done with an empty xml. | ||||
Response: 400 | Response: 400 | ||||
""" | """ | ||||
update_uri = reverse( | update_uri = reverse( | ||||
EDIT_SE_IRI, args=[deposit_collection.name, complete_deposit.id] | EDIT_SE_IRI, args=[deposit_collection.name, complete_deposit.id] | ||||
) | ) | ||||
for atom_key in ["entry-data-empty-body", "entry-data-empty-body-no-namespace"]: | |||||
atom_content = atom_dataset[atom_key] | |||||
response = authenticated_client.put( | response = authenticated_client.put( | ||||
update_uri, | update_uri, | ||||
content_type="application/atom+xml;type=entry", | content_type="application/atom+xml;type=entry", | ||||
data=atom_dataset["entry-data-empty-body"], | data=atom_content, | ||||
HTTP_X_CHECK_SWHID=complete_deposit.swh_id, | HTTP_X_CHECK_SWHID=complete_deposit.swh_id, | ||||
) | ) | ||||
assert response.status_code == status.HTTP_400_BAD_REQUEST | assert response.status_code == status.HTTP_400_BAD_REQUEST | ||||
assert b"Empty body request is not supported" in response.content | assert b"Empty body request is not supported" in response.content | ||||
def test_put_update_metadata_done_deposit_failure_functional_checks( | def test_put_update_metadata_done_deposit_failure_functional_checks( | ||||
tmp_path, | tmp_path, | ||||
authenticated_client, | authenticated_client, | ||||
complete_deposit, | complete_deposit, | ||||
deposit_collection, | deposit_collection, | ||||
atom_dataset, | atom_dataset, | ||||
Show All 26 Lines |