authenticated_client = <rest_framework.test.APIClient object at 0x7fb00737b978>
deposit_collection = <DepositCollection: {'id': 71, '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', ...}
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fb0066294a8>
deposit_user = <DepositClient: {'id': 69, 'collections': [71], 'username': 'test', 'domain': 'archives-ouvertes.fr/', 'provider_url': 'https://hal-test.archives-ouvertes.fr/'}>
sample_archive = {'data': b'PK\x03\x04\x14\x00\x00\x00\x00\x00svWT\xcba\xb4c\x14\x00\x00\x00\x14\x00\x00\x00\x05\x00\x00\x00file1some c...s/pytest-0/test_post_deposit_multipart0/tmpaduwu1u3', 'length': 128, 'md5sum': 'a6df1d271f68ff8fc2c0d3c62f085446', ...}
def test_post_deposit_multipart(
authenticated_client,
deposit_collection,
atom_dataset,
mocker,
deposit_user,
sample_archive,
):
# given
external_id = "foobar"
origin_url = deposit_user.provider_url + external_id
url = reverse(COL_IRI, args=[deposit_collection.name])
data_atom_entry = atom_dataset["entry-data0"] % origin_url
# when
response = post_multipart(
authenticated_client,
url,
sample_archive,
data_atom_entry,
HTTP_IN_PROGRESS="false",
)
> 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:45: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Feb 23 2022, 3:56 PM