Skip to content

Commit

Permalink
Print product request body
Browse files Browse the repository at this point in the history
  • Loading branch information
helen-brown committed Sep 29, 2023
1 parent f4c6427 commit f71dae3
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,27 +117,6 @@ def get_authorised_headers(client_app: Dict, environment: str, _jwt_keys):
return {"Authorization": f'Bearer {token["access_token"]}'}


def check_for_unauthorised_headers(client_app: Dict, environment: str, _jwt_keys):
with pytest.raises(RuntimeError) as exc_info:
client_credentials_config = ClientCredentialsConfig(
environment=environment,
identity_service_base_url=get_oath_url(environment),
client_id=client_app["credentials"][0]["consumerKey"],
jwt_private_key=_jwt_keys["private_key_pem"],
jwt_kid="test-1",
)
client_credentials_authenticator = ClientCredentialsAuthenticator(config=client_credentials_config)
client_credentials_authenticator.get_token()

message = json.loads(str(exc_info.value))
assert message.keys()[0] == 401 # response status_code
assert message["0"]["error"] == "unauthorized_client"
assert (
message["0"]["error_description"]
== "you have tried to request authorization but your application is not configured to use this authorization grant type"
)


def get_token_nhs_login_token_exchange(
test_app,
environment: str,
Expand Down Expand Up @@ -210,7 +189,7 @@ def _create_product(product_name: str, products_api: ApiProductsAPI, proxies: Li
"quotaTimeUnit": "minute",
"scopes": scopes
}

print(body)
product = json.dumps(body)
print(product)

Expand Down

0 comments on commit f71dae3

Please sign in to comment.