tests: add callback to clear timezone cache on settings update (#89097)
gitea/chrono/pipeline/head This commit looks good
Details
gitea/chrono/pipeline/head This commit looks good
Details
This commit is contained in:
parent
d03e1e7940
commit
5a90c4851b
|
@ -1,5 +1,9 @@
|
|||
import django_webtest
|
||||
import pytest
|
||||
from django.core.signals import setting_changed
|
||||
from django.dispatch import receiver
|
||||
|
||||
from chrono.utils.timezone import get_default_timezone
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
@ -23,3 +27,10 @@ def nocache(settings):
|
|||
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@receiver(setting_changed)
|
||||
def update_connections_time_zone(**kwargs):
|
||||
if kwargs['setting'] == 'TIME_ZONE':
|
||||
# Reset local time zone lru cache
|
||||
get_default_timezone.cache_clear()
|
||||
|
|
Loading…
Reference in New Issue