diff --git a/django_multitenant/tests/test_utils.py b/django_multitenant/tests/test_utils.py index 0c75dff..926d4e8 100644 --- a/django_multitenant/tests/test_utils.py +++ b/django_multitenant/tests/test_utils.py @@ -58,6 +58,7 @@ def test_tenant_persists_from_async_task_to_thread(self): account = projects[0].account with self.settings(TENANT_USE_ASGIREF=True): + importlib.reload(sys.modules["django_multitenant.settings"]) importlib.reload(sys.modules["django_multitenant.utils"]) # Set the tenant in task @@ -66,6 +67,7 @@ def test_tenant_persists_from_async_task_to_thread(self): unset_current_tenant() with self.settings(TENANT_USE_ASGIREF=False): + importlib.reload(sys.modules["django_multitenant.settings"]) importlib.reload(sys.modules["django_multitenant.utils"]) # Set the tenant in task diff --git a/django_multitenant/utils.py b/django_multitenant/utils.py index c3a9d2d..6ba0947 100644 --- a/django_multitenant/utils.py +++ b/django_multitenant/utils.py @@ -1,10 +1,10 @@ import inspect from django.apps import apps -from django.conf import settings +from .settings import TENANT_USE_ASGIREF -if settings.TENANT_USE_ASGIREF: +if TENANT_USE_ASGIREF: # asgiref must be installed, its included with Django >= 3.0 from asgiref.local import Local as local else: