authenticated_client = <rest_framework.test.APIClient object at 0x7f7cf6cbaeb8>
deposit_collection = <DepositCollection: {'id': 149, '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', ...}
deposit_user = <DepositClient: {'id': 145, 'collections': [149], 'username': 'test', 'domain': 'archives-ouvertes.fr/', 'provider_url': 'https://hal-test.archives-ouvertes.fr/'}>
def test_put_atom_with_create_origin_and_external_identifier(
authenticated_client, deposit_collection, atom_dataset, deposit_user
):
"""<atom:external_identifier> was deprecated before <swh:create_origin>
was introduced, clients should get an error when trying to use both
"""
external_id = "foobar"
origin_url = deposit_user.provider_url + external_id
url = reverse(COL_IRI, args=[deposit_collection.name])
response = post_atom(
authenticated_client,
url,
data=atom_dataset["entry-data0"] % origin_url,
HTTP_IN_PROGRESS="true",
)
> 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_deposit_update_atom.py:544: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Feb 23 2022, 1:52 PM