Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
glasserc committed Feb 4, 2019
1 parent ff5f605 commit c153ae1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/core/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
10 changes: 5 additions & 5 deletions tests/plugins/test_openid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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):
Expand Down

0 comments on commit c153ae1

Please sign in to comment.