Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/tests/api/test_service_document.py
# Copyright (C) 2017-2019 The Software Heritage developers | # Copyright (C) 2017-2019 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
from django.urls import reverse | from django.urls import reverse | ||||
from rest_framework import status | from rest_framework import status | ||||
from swh.deposit.tests import TEST_CONFIG | |||||
from swh.deposit.config import SD_IRI | from swh.deposit.config import SD_IRI | ||||
def test_service_document_no_auth_fails(client): | def test_service_document_no_auth_fails(client): | ||||
"""Without authentication, service document endpoint should return 401 | """Without authentication, service document endpoint should return 401 | ||||
""" | """ | ||||
url = reverse(SD_IRI) | url = reverse(SD_IRI) | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | <workspace> | ||||
<sword:mediation>false</sword:mediation> | <sword:mediation>false</sword:mediation> | ||||
<sword:metadataRelevantHeader>false</sword:metadataRelevantHeader> | <sword:metadataRelevantHeader>false</sword:metadataRelevantHeader> | ||||
<sword:acceptPackaging>http://purl.org/net/sword/package/SimpleZip</sword:acceptPackaging> | <sword:acceptPackaging>http://purl.org/net/sword/package/SimpleZip</sword:acceptPackaging> | ||||
<sword:service>http://testserver/1/%s/</sword:service> | <sword:service>http://testserver/1/%s/</sword:service> | ||||
<sword:name>%s</sword:name> | <sword:name>%s</sword:name> | ||||
</collection> | </collection> | ||||
</workspace> | </workspace> | ||||
</service> | </service> | ||||
''' % (TEST_CONFIG['max_upload_size'], | ''' % (500, | ||||
username, | username, | ||||
username, | username, | ||||
username, | username, | ||||
username) # noqa | username) # noqa |