Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/tests/api/test_collection_post_metadata.py
Show First 20 Lines • Show All 200 Lines • ▼ Show 20 Lines | @pytest.mark.parametrize( | ||||
"url", ["https://gitlab.org/user/repo", "https://whatever.else/repo",] | "url", ["https://gitlab.org/user/repo", "https://whatever.else/repo",] | ||||
) | ) | ||||
def test_deposit_metadata_origin( | def test_deposit_metadata_origin( | ||||
url, authenticated_client, deposit_collection, atom_dataset, swh_storage, | url, authenticated_client, deposit_collection, atom_dataset, swh_storage, | ||||
): | ): | ||||
"""Posting a swhid reference is stored on raw extrinsic metadata storage | """Posting a swhid reference is stored on raw extrinsic metadata storage | ||||
""" | """ | ||||
xml_data = atom_dataset["entry-data-with-origin"].format(url=url) | xml_data = atom_dataset["entry-data-with-origin-reference"].format(url=url) | ||||
deposit_client = authenticated_client.deposit_client | deposit_client = authenticated_client.deposit_client | ||||
response = authenticated_client.post( | response = authenticated_client.post( | ||||
reverse(COL_IRI, args=[deposit_collection.name]), | reverse(COL_IRI, args=[deposit_collection.name]), | ||||
content_type="application/atom+xml;type=entry", | content_type="application/atom+xml;type=entry", | ||||
data=xml_data, | data=xml_data, | ||||
) | ) | ||||
assert response.status_code == status.HTTP_201_CREATED | assert response.status_code == status.HTTP_201_CREATED | ||||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |