sources/oauth: start adding tests for types

This commit is contained in:
Jens Langhammer
2020-12-13 19:53:26 +01:00
parent d380194e13
commit 0083cd55df
11 changed files with 232 additions and 9 deletions

View File

@ -0,0 +1,37 @@
"""OAuth Source tests"""
from django.shortcuts import reverse
from django.test import TestCase
from authentik.sources.oauth.models import OAuthSource
class TestOAuthSource(TestCase):
"""OAuth Source tests"""
def setUp(self):
self.source = OAuthSource.objects.create(
name="test",
slug="test",
provider_type="openid-connect",
authorization_url="",
profile_url="",
consumer_key="",
)
def test_source_redirect(self):
"""test redirect view"""
self.client.get(
reverse(
"authentik_sources_oauth:oauth-client-login",
kwargs={"source_slug": self.source.slug},
)
)
def test_source_callback(self):
"""test callback view"""
self.client.get(
reverse(
"authentik_sources_oauth:oauth-client-callback",
kwargs={"source_slug": self.source.slug},
)
)