Skip to content

Commit

Permalink
Refactor test
Browse files Browse the repository at this point in the history
  • Loading branch information
disrupted committed Feb 27, 2024
1 parent 32cf6d9 commit e7044cd
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/test_oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,11 @@ def test_login_redirect(self, client: TestClient, keycloak: KeycloakAdmin):
assert response.url.port == keycloak_base_url.port
assert response.url.path == "/realms/bakdata/protocol/openid-connect/auth"
assert response.url.params["client_id"] == "test-client"
assert response.url.params["redirect_uri"]
assert URL(response.url.params["redirect_uri"]).path == "/auth/callback"
assert URL(response.url.params["redirect_uri"]) == client.base_url.copy_with(
path="/auth/callback"
)
redirect_uri = URL(response.url.params["redirect_uri"])
assert redirect_uri.hostname == client.base_url.host
assert redirect_uri.path == "/auth/callback"

# call Keycloak
response = httpx.get(response.url)
assert response.status_code == status.HTTP_200_OK

Expand Down

0 comments on commit e7044cd

Please sign in to comment.