Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/tests/api/conftest.py
Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | response = authenticated_client.post( | ||||
# other headers needs HTTP_ prefix to be taken into account | # other headers needs HTTP_ prefix to be taken into account | ||||
HTTP_SLUG="external-id-invalid", | HTTP_SLUG="external-id-invalid", | ||||
HTTP_CONTENT_MD5=md5sum, | HTTP_CONTENT_MD5=md5sum, | ||||
HTTP_PACKAGING="http://purl.org/net/sword/package/SimpleZip", | HTTP_PACKAGING="http://purl.org/net/sword/package/SimpleZip", | ||||
HTTP_CONTENT_DISPOSITION="attachment; filename=filename0", | HTTP_CONTENT_DISPOSITION="attachment; filename=filename0", | ||||
) | ) | ||||
response_content = parse_xml(response.content) | response_content = parse_xml(response.content) | ||||
deposit_id = int(response_content["deposit_id"]) | deposit_id = int(response_content["swh:deposit_id"]) | ||||
deposit = Deposit.objects.get(pk=deposit_id) | deposit = Deposit.objects.get(pk=deposit_id) | ||||
deposit.status = DEPOSIT_STATUS_DEPOSITED | deposit.status = DEPOSIT_STATUS_DEPOSITED | ||||
deposit.save() | deposit.save() | ||||
return deposit | return deposit | ||||
@pytest.fixture | @pytest.fixture | ||||
def swh_checks_deposit(): | def swh_checks_deposit(): | ||||
return APIChecks() | return APIChecks() |