diff --git a/docs/models/dcim/site.md b/docs/models/dcim/site.md index c74c209e1..2e35ab11f 100644 --- a/docs/models/dcim/site.md +++ b/docs/models/dcim/site.md @@ -33,7 +33,7 @@ Each site can have multiple [AS numbers](../ipam/asn.md) assigned to it. ### Time Zone -The site's local time zone. (Time zones are provided by the [pytz](https://pypi.org/project/pytz/) package.) +The site's local time zone. (Time zones are provided by the [zoneinfo](https://docs.python.org/3/library/zoneinfo.html) library.) ### Physical Address diff --git a/docs/release-notes/version-3.4.md b/docs/release-notes/version-3.4.md index 43e649f7b..e337c8642 100644 --- a/docs/release-notes/version-3.4.md +++ b/docs/release-notes/version-3.4.md @@ -59,6 +59,7 @@ A new `PluginMenu` class has been introduced, which enables a plugin to inject a * [#10697](https://github.com/netbox-community/netbox/issues/10697) - Move application registry into core app * [#10699](https://github.com/netbox-community/netbox/issues/10699) - Remove custom `import_object()` function * [#10816](https://github.com/netbox-community/netbox/issues/10816) - Pass the current request when instantiating a FilterSet within UI views +* [#10820](https://github.com/netbox-community/netbox/issues/10820) - Switch timezone library from pytz to zoneinfo ### REST API Changes diff --git a/netbox/dcim/tests/test_views.py b/netbox/dcim/tests/test_views.py index 8bf1c1948..4c111be52 100644 --- a/netbox/dcim/tests/test_views.py +++ b/netbox/dcim/tests/test_views.py @@ -1,7 +1,7 @@ from decimal import Decimal -import pytz import yaml +from backports.zoneinfo import ZoneInfo from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.test import override_settings @@ -12,7 +12,6 @@ from dcim.choices import * from dcim.constants import * from dcim.models import * from ipam.models import ASN, RIR, VLAN, VRF -from netbox.api.serializers import GenericObjectSerializer from tenancy.models import Tenant from utilities.testing import ViewTestCases, create_tags, create_test_device, post_data from wireless.models import WirelessLAN @@ -153,7 +152,7 @@ class SiteTestCase(ViewTestCases.PrimaryObjectViewTestCase): 'tenant': None, 'facility': 'Facility X', 'asns': [asns[6].pk, asns[7].pk], - 'time_zone': pytz.UTC, + 'time_zone': ZoneInfo('UTC'), 'description': 'Site description', 'physical_address': '742 Evergreen Terrace, Springfield, USA', 'shipping_address': '742 Evergreen Terrace, Springfield, USA', @@ -182,7 +181,7 @@ class SiteTestCase(ViewTestCases.PrimaryObjectViewTestCase): 'region': regions[1].pk, 'group': groups[1].pk, 'tenant': None, - 'time_zone': pytz.timezone('US/Eastern'), + 'time_zone': ZoneInfo('US/Eastern'), 'description': 'New description', } diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index 4e93eb149..2a9d43df0 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -389,7 +389,6 @@ LANGUAGE_CODE = 'en-us' USE_I18N = True USE_L10N = False USE_TZ = True -USE_DEPRECATED_PYTZ = True # WSGI WSGI_APPLICATION = 'netbox.wsgi.application'