summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-04-22 19:02:06 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-04-22 19:02:06 +0100
commit92161ae9ed888d0af03ed2d889f5197bbd4f5bad (patch)
treea97c81b21593a299b75ca30a73a4cabbc479dd5e /tests
parentMerge commit '261093072' into anoa/dinsic_release_1_31_0 (diff)
parentSocial login UI polish (#9301) (diff)
downloadsynapse-92161ae9ed888d0af03ed2d889f5197bbd4f5bad.tar.xz
Merge commit 'e288499c6' into anoa/dinsic_release_1_31_0
Diffstat (limited to 'tests')
-rw-r--r--tests/rest/client/v1/test_login.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/rest/client/v1/test_login.py b/tests/rest/client/v1/test_login.py

index 66dfdaffbc..ceb4ad2366 100644 --- a/tests/rest/client/v1/test_login.py +++ b/tests/rest/client/v1/test_login.py
@@ -15,7 +15,7 @@ import time import urllib.parse -from typing import Any, Dict, Union +from typing import Any, Dict, List, Union from urllib.parse import urlencode from mock import Mock @@ -493,13 +493,21 @@ class MultiSSOTestCase(unittest.HomeserverTestCase): self.assertEqual(channel.code, 200, channel.result) # parse the form to check it has fields assumed elsewhere in this class + html = channel.result["body"].decode("utf-8") p = TestHtmlParser() - p.feed(channel.result["body"].decode("utf-8")) + p.feed(html) p.close() - self.assertCountEqual(p.radios["idp"], ["cas", "oidc", "oidc-idp1", "saml"]) + # there should be a link for each href + returned_idps = [] # type: List[str] + for link in p.links: + path, query = link.split("?", 1) + self.assertEqual(path, "pick_idp") + params = urllib.parse.parse_qs(query) + self.assertEqual(params["redirectUrl"], [TEST_CLIENT_REDIRECT_URL]) + returned_idps.append(params["idp"][0]) - self.assertEqual(p.hiddens["redirectUrl"], TEST_CLIENT_REDIRECT_URL) + self.assertCountEqual(returned_idps, ["cas", "oidc", "oidc-idp1", "saml"]) def test_multi_sso_redirect_to_cas(self): """If CAS is chosen, should redirect to the CAS server"""