authenticated_client = <rest_framework.test.APIClient object at 0x7f7cf73e1208>
deposit_collection = <DepositCollection: {'id': 75, 'name': 'test'}>
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', ...}
sample_archive = {'data': b'PK\x03\x04\x14\x00\x00\x00\x00\x00\xf2eWT\xcba\xb4c\x14\x00\x00\x00\x14\x00\x00\x00\x05\x00\x00\x00file1som...ytest-0/test_post_deposit_multipart_pu0/tmp7zcpbxi1', 'length': 128, 'md5sum': '9b3113acd2127d0d458a597bb1759fe3', ...}
def test_post_deposit_multipart_put_to_replace_metadata(
authenticated_client, deposit_collection, atom_dataset, sample_archive
):
"""One multipart deposit followed by a metadata update should be
accepted
"""
# given
url = reverse(COL_IRI, args=[deposit_collection.name])
data_atom_entry = atom_dataset["entry-data-deposit-binary"]
external_id = "external-id"
# when
response = post_multipart(
authenticated_client,
url,
sample_archive,
data_atom_entry,
HTTP_IN_PROGRESS="true",
HTTP_SLUG=external_id,
)
# then
> assert response.status_code == status.HTTP_201_CREATED
E assert 400 == 201
E +400
E -201
.tox/py3/lib/python3.7/site-packages/swh/deposit/tests/api/test_collection_post_multipart.py:209: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Feb 23 2022, 1:52 PM