This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/authentik/outposts/tests/test_api.py
Jens Langhammer 1dc01ef857 *: add API tests for types endpoints
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
2021-04-02 23:11:53 +02:00

25 lines
816 B
Python

"""Test outpost service connection API"""
from django.urls import reverse
from rest_framework.test import APITestCase
from authentik.core.models import PropertyMapping, User
class TestOutpostServiceConnectionsAPI(APITestCase):
"""Test outpost service connection API"""
def setUp(self) -> None:
super().setUp()
self.mapping = PropertyMapping.objects.create(
name="dummy", expression="""return {'foo': 'bar'}"""
)
self.user = User.objects.get(username="akadmin")
self.client.force_login(self.user)
def test_types(self):
"""Test OutpostServiceConnections's types endpoint"""
response = self.client.get(
reverse("authentik_api:outpostserviceconnection-types"),
)
self.assertEqual(response.status_code, 200)