diff --git a/tfjm/helloasso.py b/tfjm/helloasso/__init__.py similarity index 95% rename from tfjm/helloasso.py rename to tfjm/helloasso/__init__.py index 1a08e50..de41fb8 100644 --- a/tfjm/helloasso.py +++ b/tfjm/helloasso/__init__.py @@ -6,14 +6,15 @@ from datetime import datetime, timedelta from django.conf import settings import requests - _access_token = None _refresh_token = None _expires_at = None def _get_hello_asso_api_base_url(): - if not settings.DEBUG: + if settings.HELLOASSO_TEST_ENDPOINT: + return f"{settings.HELLOASSO_TEST_ENDPOINT_URL}/helloasso-test" + elif not settings.DEBUG: return "https://api.helloasso.com" else: return "https://api.helloasso-sandbox.com"