summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2018-03-07 17:08:53 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2018-03-07 17:09:44 (GMT)
commitbe791d54a89d302e39258a2cc8321494f8a60e03 (patch)
treeefa713f59f0616588768ac6f5739986b10492739
parentb66a974922031728fbdbcb2683ed3fdf13ec47c4 (diff)
downloaddjango-mellon-be791d54a89d302e39258a2cc8321494f8a60e03.zip
django-mellon-be791d54a89d302e39258a2cc8321494f8a60e03.tar.gz
django-mellon-be791d54a89d302e39258a2cc8321494f8a60e03.tar.bz2
set a default value for IDENTITY_PROVIDERS ((fixes #20221)
-rw-r--r--mellon/adapters.py3
-rw-r--r--mellon/app_settings.py1
-rw-r--r--tests/test_views.py6
3 files changed, 1 insertions, 9 deletions
diff --git a/mellon/adapters.py b/mellon/adapters.py
index a4dff9d..bbf56e1 100644
--- a/mellon/adapters.py
+++ b/mellon/adapters.py
@@ -28,9 +28,6 @@ class DefaultAdapter(object):
return idp
def get_identity_providers_setting(self):
- if not app_settings.IDENTITY_PROVIDERS:
- from django.core.exceptions import ImproperlyConfigured
- raise ImproperlyConfigured('The MELLON_IDENTITY_PROVIDERS setting is mandatory')
return app_settings.IDENTITY_PROVIDERS
def get_idps(self):
diff --git a/mellon/app_settings.py b/mellon/app_settings.py
index 131ba9c..2355e8a 100644
--- a/mellon/app_settings.py
+++ b/mellon/app_settings.py
@@ -4,6 +4,7 @@ import sys
class AppSettings(object):
__PREFIX = 'MELLON_'
__DEFAULTS = {
+ 'IDENTITY_PROVIDERS': [],
'DISCOVERY_SERVICE_URL': None,
'PUBLIC_KEYS': (),
'PRIVATE_KEY': None,
diff --git a/tests/test_views.py b/tests/test_views.py
index 44d4c8e..2cbc9b4 100644
--- a/tests/test_views.py
+++ b/tests/test_views.py
@@ -8,7 +8,6 @@ import hashlib
from httmock import HTTMock
from django.core.urlresolvers import reverse
-from django.core.exceptions import ImproperlyConfigured
from django.utils.http import urlencode
from xml_utils import assert_xml_constraints
@@ -122,11 +121,6 @@ def test_metadata(private_settings, client):
namespaces=ns)
-def test_sp_initiated_login_improperly_configured(private_settings, client):
- with pytest.raises(ImproperlyConfigured):
- client.get('/login/')
-
-
def test_sp_initiated_login_improperly_configured2(private_settings, client):
private_settings.MELLON_IDENTITY_PROVIDERS = []
response = client.get('/login/')