Skip to content

Commit

Permalink
DPAT-0000 try fix the failed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ymao2 committed Nov 10, 2023
1 parent 075d096 commit c4accad
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions controlpanel/api/auth0.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,9 @@ def _init_authorization_extension_apis(self):
)

def _access_token(self, audience):
get_token = authentication.GetToken(self.domain)
get_token = authentication.GetToken(self.domain, client_id=self.client_id)
try:
token = get_token.client_credentials(
self.client_id, self.client_secret, audience
)
token = get_token.client_credentials(audience)
except exceptions.Auth0Error as error:
error_detail = (
f"Access token error: {self.client_id}, {self.domain}, {error}"
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ beautifulsoup4==4.12.2
boto3==1.26.143
celery[sqs]==5.3.1
channels==4.0.0
channels-redis==4.1.0
channels-redis==4.0.0
daphne==4.0.0
Django==4.2.7
django-crequest==2018.5.11
django-extensions==3.2.3
django-filter==22.1
django-prometheus==2.1.0
django-redis==5.3.0
django-redis==5.4.0
django-simple-history==3.3.0
django-structlog==2.2.0
djangorestframework==3.14.0
Expand Down
2 changes: 1 addition & 1 deletion tests/api/test_auth0.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@pytest.fixture()
def ExtendedAuth0():
with patch(
"auth0.v3.authentication.GetToken.client_credentials"
"auth0.authentication.GetToken.client_credentials"
) as client_credentials:
client_credentials.return_value = {"access_token": "access_token_testing"}
yield auth0.ExtendedAuth0()
Expand Down

0 comments on commit c4accad

Please sign in to comment.