From c153ae1d2056211d2f90ad088541b55d5d1d6fa3 Mon Sep 17 00:00:00 2001 From: Ethan Glasser-Camp Date: Mon, 4 Feb 2019 10:34:17 -0500 Subject: [PATCH] Fix tests --- tests/core/test_schema.py | 2 +- tests/plugins/test_openid.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/core/test_schema.py b/tests/core/test_schema.py index 40271d544..687306d36 100644 --- a/tests/core/test_schema.py +++ b/tests/core/test_schema.py @@ -26,7 +26,7 @@ def test_default_value_is_none_if_not_autonow(self): class URLTest(unittest.TestCase): def test_supports_full_url(self): - url = "https://user:pass@myserver:9999/feeling.html#anchor" + url = "https://myserver.example.com:9999/feeling.html#anchor" deserialized = schema.URL().deserialize(url) self.assertEqual(deserialized, url) diff --git a/tests/plugins/test_openid.py b/tests/plugins/test_openid.py index 8ab9dc23b..5e9b31100 100644 --- a/tests/plugins/test_openid.py +++ b/tests/plugins/test_openid.py @@ -245,7 +245,7 @@ def test_returns_400_if_provider_is_unknown(self): def test_returns_400_if_email_is_not_in_scope_when_userid_field_is_email(self): scope = "openid" - cb = "http://ui" + cb = "http://ui.kinto.example.com" self.app.get("/openid/auth0/login", params={"callback": cb, "scope": scope}, status=307) # See config above (email is userid field) self.app.get("/openid/google/login", params={"callback": cb, "scope": scope}, status=400) @@ -260,7 +260,7 @@ def test_returns_400_if_prompt_is_not_recognized(self): ) def test_redirects_to_the_identity_provider(self): - params = {"callback": "http://ui", "scope": "openid"} + params = {"callback": "http://ui.kinto.example.com", "scope": "openid"} resp = self.app.get("/openid/auth0/login", params=params, status=307) location = resp.headers["Location"] assert "auth0.com/authorize?" in location @@ -269,7 +269,7 @@ def test_redirects_to_the_identity_provider(self): assert "client_id=abc" in location def test_redirects_to_the_identity_provider_with_prompt_none(self): - params = {"callback": "http://ui", "scope": "openid", "prompt": "none"} + params = {"callback": "http://ui.kinto.example.com", "scope": "openid", "prompt": "none"} resp = self.app.get("/openid/auth0/login", params=params, status=307) location = resp.headers["Location"] assert "auth0.com/authorize?" in location @@ -279,13 +279,13 @@ def test_redirects_to_the_identity_provider_with_prompt_none(self): assert "prompt=none" in location def test_callback_is_stored_in_cache(self): - params = {"callback": "http://ui", "scope": "openid"} + params = {"callback": "http://ui.kinto.example.com", "scope": "openid"} with mock.patch("kinto.plugins.openid.views.random_bytes_hex") as m: m.return_value = "key" self.app.get("/openid/auth0/login", params=params, status=307) cached = self.app.app.registry.cache.get("openid:state:key") - assert cached == "http://ui" + assert cached == "http://ui.kinto.example.com" class TokenViewTest(OpenIDWebTest):