summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2017-09-27 19:56:47 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2017-09-27 19:59:15 (GMT)
commitcb3e18c8bafadaa18fb922602bfdf8c56cf79d3b (patch)
tree1f55cc097a427f94db4b6eb8ca7456c0f2dd5a20
parent1703cc5da22d370e97427b83fac869665e27f626 (diff)
downloaddjango-mellon-cb3e18c8bafadaa18fb922602bfdf8c56cf79d3b.zip
django-mellon-cb3e18c8bafadaa18fb922602bfdf8c56cf79d3b.tar.gz
django-mellon-cb3e18c8bafadaa18fb922602bfdf8c56cf79d3b.tar.bz2
tests: fix discovery service tests (#19018 #19016)
-rw-r--r--mellon/views.py2
-rw-r--r--tests/test_views.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/mellon/views.py b/mellon/views.py
index aac9764..e01dc13 100644
--- a/mellon/views.py
+++ b/mellon/views.py
@@ -317,7 +317,7 @@ class LoginView(ProfileMixin, LogMixin, View):
url = app_settings.DISCOVERY_SERVICE_URL
params = {
# prevent redirect loops with the discovery service
- 'entityID': reverse('mellon_metadata'),
+ 'entityID': request.build_absolute_uri(reverse('mellon_metadata')),
'return': self_url + '?nodisco=1',
}
if is_passive:
diff --git a/tests/test_views.py b/tests/test_views.py
index 9c63427..44d4c8e 100644
--- a/tests/test_views.py
+++ b/tests/test_views.py
@@ -140,8 +140,8 @@ def test_sp_initiated_login_discovery_service(private_settings, client):
assert response.status_code == 302
params = parse_qs(urlparse(response['Location']).query)
assert response['Location'].startswith('https://disco?')
- assert params == {'return': ['http://testserver/login/'],
- 'nodisco': ['1']}
+ assert params == {'return': ['http://testserver/login/?nodisco=1'],
+ 'entityID': ['http://testserver/metadata/']}
def test_sp_initiated_login_discovery_service_passive(private_settings, client):
@@ -151,8 +151,8 @@ def test_sp_initiated_login_discovery_service_passive(private_settings, client):
params = parse_qs(urlparse(response['Location']).query)
assert response['Location'].startswith('https://disco?')
assert params == {'isPassive': ['true'],
- 'return': ['http://testserver/login/'],
- 'nodisco': ['1']}
+ 'entityID': ['http://testserver/metadata/'],
+ 'return': ['http://testserver/login/?nodisco=1']}
def test_sp_initiated_login_discovery_service_nodisco(private_settings, client):