From c4accadc64691cebc9b286395cd8ae222665469d Mon Sep 17 00:00:00 2001 From: ymao2 Date: Fri, 10 Nov 2023 09:34:33 +0000 Subject: [PATCH] DPAT-0000 try fix the failed tests --- controlpanel/api/auth0.py | 6 ++---- requirements.txt | 4 ++-- tests/api/test_auth0.py | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/controlpanel/api/auth0.py b/controlpanel/api/auth0.py index ce13bd925..76f3068fa 100644 --- a/controlpanel/api/auth0.py +++ b/controlpanel/api/auth0.py @@ -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}" diff --git a/requirements.txt b/requirements.txt index 2e74ad3db..fb09285da 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/tests/api/test_auth0.py b/tests/api/test_auth0.py index d945f07aa..a1788dd04 100644 --- a/tests/api/test_auth0.py +++ b/tests/api/test_auth0.py @@ -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()