Skip to content

Commit

Permalink
Fix tests to use newer OIDC backend for temporary users. Enable OIDC …
Browse files Browse the repository at this point in the history
…backend by default in environ settings.
  • Loading branch information
Kurocon committed Sep 9, 2024
1 parent f1e422f commit 63ff40c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion alexia/conf/settings/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ def get_random_secret_key_no_dollar():

# Django authentication backends
# Login settings -- only allow login using specified backends
AUTHENTICATION_BACKENDS = env.list("DJANGO_AUTHENTICATION_BACKENDS", default=["django.contrib.auth.backends.ModelBackend"])
AUTHENTICATION_BACKENDS = env.list("DJANGO_AUTHENTICATION_BACKENDS", default=[
"django.contrib.auth.backends.ModelBackend", "alexia.auth.backends.IAOIDCAuthenticationBackend"
])

# OIDC Single sign-on configuration
OIDC_RP_CLIENT_ID = env("OIDC_RP_CLIENT_ID", default="alexia")
Expand Down
6 changes: 3 additions & 3 deletions alexia/test/testcases.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
AuthenticationData, Location, Organization, Profile,
)
from alexia.apps.scheduling.models import Availability, Event
from alexia.auth.backends import RADIUS_BACKEND_NAME
from alexia.auth.backends import OIDC_BACKEND_NAME


class SimpleTestCase(testcases.SimpleTestCase):
Expand Down Expand Up @@ -78,7 +78,7 @@ def load_organization_data(self):
data['user1'].profile = Profile()
data['user1'].profile.save()

data['authenticationdata1'] = AuthenticationData(backend=RADIUS_BACKEND_NAME, username=username1,
data['authenticationdata1'] = AuthenticationData(backend=OIDC_BACKEND_NAME, username=username1,
user=data['user1'])
data['authenticationdata1'].save()

Expand All @@ -89,7 +89,7 @@ def load_organization_data(self):
data['user2'].profile = Profile()
data['user2'].profile.save()

data['authenticationdata2'] = AuthenticationData(backend=RADIUS_BACKEND_NAME, username=username2,
data['authenticationdata2'] = AuthenticationData(backend=OIDC_BACKEND_NAME, username=username2,
user=data['user2'])
data['authenticationdata2'].save()

Expand Down

0 comments on commit 63ff40c

Please sign in to comment.