Changeset View
Changeset View
Standalone View
Standalone View
swh/web/tests/misc/test_origin_save.py
# Copyright (C) 2019-2021 The Software Heritage developers | # Copyright (C) 2019-2021 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 Affero General Public License version 3, or any later version | # License: GNU Affero 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 datetime import datetime, timedelta, timezone | from datetime import datetime, timedelta, timezone | ||||
import json | import json | ||||
import pytest | import pytest | ||||
from swh.auth.django.utils import oidc_user_from_profile | from swh.auth.django.utils import oidc_user_from_profile | ||||
from swh.web.common.models import SaveOriginRequest | from swh.web.common.models import SaveOriginRequest | ||||
from swh.web.common.origin_save import SAVE_REQUEST_ACCEPTED, SAVE_TASK_SUCCEEDED | from swh.web.common.origin_save import SAVE_REQUEST_ACCEPTED, SAVE_TASK_SUCCEEDED | ||||
from swh.web.common.utils import reverse | from swh.web.common.utils import reverse | ||||
from swh.web.tests.utils import check_http_get_response | from swh.web.tests.utils import check_http_get_response | ||||
VISIT_TYPES = ("git", "svn", "hg") | VISIT_TYPES = ("git", "svn", "hg", "cvs") | ||||
PRIVILEGED_VISIT_TYPES = tuple(list(VISIT_TYPES) + ["archives"]) | PRIVILEGED_VISIT_TYPES = tuple(list(VISIT_TYPES) + ["archives"]) | ||||
def test_old_save_url_redirection(client): | def test_old_save_url_redirection(client): | ||||
url = reverse("browse-origin-save") | url = reverse("browse-origin-save") | ||||
redirect_url = reverse("origin-save") | redirect_url = reverse("origin-save") | ||||
resp = check_http_get_response(client, url, status_code=302) | resp = check_http_get_response(client, url, status_code=302) | ||||
▲ Show 20 Lines • Show All 128 Lines • Show Last 20 Lines |