Skip to content

Commit

Permalink
[IMP] auth_oidc: parametrize KEYCLOAK_URL in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OdyX committed Feb 12, 2025
1 parent c6c0786 commit 5c9f15a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions auth_oidc/tests/test_auth_oidc_auth_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from ..controllers.main import OpenIDLogin

BASE_URL = "http://localhost:%s" % odoo.tools.config["http_port"]
KEYCLOAK_URL = "http://localhost:8080"


@contextlib.contextmanager
Expand Down Expand Up @@ -119,7 +120,7 @@ def _prepare_login_test_responses(
id_token_headers = {"kid": "the_key_id"}
responses.add(
responses.POST,
"http://localhost:8080/auth/realms/master/protocol/openid-connect/token",
KEYCLOAK_URL + "/auth/realms/master/protocol/openid-connect/token",
json={
"access_token": access_token,
"id_token": jwt.encode(
Expand All @@ -137,7 +138,7 @@ def _prepare_login_test_responses(
keys = [{"keys": [self.rsa_key_public_pem]}]
responses.add(
responses.GET,
"http://localhost:8080/auth/realms/master/protocol/openid-connect/certs",
KEYCLOAK_URL + "/auth/realms/master/protocol/openid-connect/certs",
json={"keys": keys},
)

Expand Down

0 comments on commit 5c9f15a

Please sign in to comment.