authenticated_client = <rest_framework.test.APIClient object at 0x7f3049ea4470>
deposit_collection = <DepositCollection: {'id': 84, 'name': 'test'}>
deposit_another_collection = <DepositCollection: {'id': 85, 'name': 'another-collection'}>
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': 82, 'collections': [84], 'username': 'test', 'domain': 'archives-ouvertes.fr/', 'provider_url': 'https://hal-test.archives-ouvertes.fr/'}>
deposit_another_user = <DepositClient: {'id': 83, 'collections': [85], 'username': 'test2', 'domain': 'archives-ouvertes.example/', 'provider_url': 'https://hal-test.archives-ouvertes.example/'}>
def test_add_deposit_external_id_conflict_no_parent(
authenticated_client,
deposit_collection,
deposit_another_collection,
atom_dataset,
deposit_user,
deposit_another_user,
):
"""Posting a deposit with an external_id conflicting with an external_id
of a different client does not create a parent relationship
"""
external_id = "foobar"
origin_url = deposit_user.provider_url + external_id
# create a deposit for that other user, with the same slug
other_deposit = internal_create_deposit(
deposit_another_user,
deposit_another_collection,
external_id,
DEPOSIT_STATUS_LOAD_SUCCESS,
)
# adding a new deposit with the same external id as a completed deposit
response = post_atom(
authenticated_client,
reverse(COL_IRI, args=[deposit_collection.name]),
data=atom_dataset["entry-data0"] % origin_url,
HTTP_SLUG=external_id,
)
> 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_reuse_slug.py:222: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Feb 23 2022, 1:52 PM