Changeset View
Changeset View
Standalone View
Standalone View
swh/web/tests/auth/test_api_auth.py
# Copyright (C) 2020 The Software Heritage developers | # Copyright (C) 2020 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 | ||||
import pytest | import pytest | ||||
from django.contrib.auth.models import AnonymousUser, User | from django.contrib.auth.models import AnonymousUser, User | ||||
from swh.web.auth.models import OIDCUser | from swh.auth.django.models import OIDCUser | ||||
from swh.web.common.utils import reverse | from swh.web.common.utils import reverse | ||||
from swh.web.tests.utils import check_api_get_responses, check_http_get_response | from swh.web.tests.utils import check_api_get_responses, check_http_get_response | ||||
@pytest.mark.django_db | @pytest.mark.django_db | ||||
def test_drf_django_session_auth_success(keycloak_mock, client): | def test_drf_django_session_auth_success(keycloak_mock, client): | ||||
""" | """ | ||||
Check user gets authenticated when querying the web api | Check user gets authenticated when querying the web api | ||||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |