Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/tests/conftest.py
Show All 22 Lines | |||||
from swh.deposit.config import ( | from swh.deposit.config import ( | ||||
COL_IRI, | COL_IRI, | ||||
DEPOSIT_STATUS_DEPOSITED, | DEPOSIT_STATUS_DEPOSITED, | ||||
DEPOSIT_STATUS_LOAD_FAILURE, | DEPOSIT_STATUS_LOAD_FAILURE, | ||||
DEPOSIT_STATUS_LOAD_SUCCESS, | DEPOSIT_STATUS_LOAD_SUCCESS, | ||||
DEPOSIT_STATUS_PARTIAL, | DEPOSIT_STATUS_PARTIAL, | ||||
DEPOSIT_STATUS_REJECTED, | DEPOSIT_STATUS_REJECTED, | ||||
DEPOSIT_STATUS_VERIFIED, | DEPOSIT_STATUS_VERIFIED, | ||||
EDIT_SE_IRI, | SE_IRI, | ||||
setup_django_for, | setup_django_for, | ||||
) | ) | ||||
from swh.deposit.parsers import parse_xml | from swh.deposit.parsers import parse_xml | ||||
from swh.deposit.tests.common import create_arborescence_archive | from swh.deposit.tests.common import create_arborescence_archive | ||||
from swh.model.identifiers import DIRECTORY, REVISION, SNAPSHOT, swhid | from swh.model.identifiers import DIRECTORY, REVISION, SNAPSHOT, swhid | ||||
from swh.scheduler import get_scheduler | from swh.scheduler import get_scheduler | ||||
# mypy is asked to ignore the import statement above because setup_databases | # mypy is asked to ignore the import statement above because setup_databases | ||||
▲ Show 20 Lines • Show All 270 Lines • ▼ Show 20 Lines | deposit = create_deposit( | ||||
authenticated_client, | authenticated_client, | ||||
collection_name, | collection_name, | ||||
sample_archive, | sample_archive, | ||||
external_id=external_id, | external_id=external_id, | ||||
deposit_status=DEPOSIT_STATUS_PARTIAL, | deposit_status=DEPOSIT_STATUS_PARTIAL, | ||||
) | ) | ||||
response = authenticated_client.post( | response = authenticated_client.post( | ||||
reverse(EDIT_SE_IRI, args=[collection_name, deposit.id]), | reverse(SE_IRI, args=[collection_name, deposit.id]), | ||||
content_type="application/atom+xml;type=entry", | content_type="application/atom+xml;type=entry", | ||||
data=atom_dataset["entry-data0"] % deposit.external_id.encode("utf-8"), | data=atom_dataset["entry-data0"] % deposit.external_id.encode("utf-8"), | ||||
HTTP_SLUG=deposit.external_id, | HTTP_SLUG=deposit.external_id, | ||||
HTTP_IN_PROGRESS="true", | HTTP_IN_PROGRESS="true", | ||||
) | ) | ||||
assert response.status_code == status.HTTP_201_CREATED | assert response.status_code == status.HTTP_201_CREATED | ||||
assert deposit.status == DEPOSIT_STATUS_PARTIAL | assert deposit.status == DEPOSIT_STATUS_PARTIAL | ||||
▲ Show 20 Lines • Show All 119 Lines • Show Last 20 Lines |