Skip to content

Commit d61b5f7

Browse files
authored
Merge pull request #10 from octoenergy/support-django-v4
Support for Django v4
2 parents 9c83a99 + bf7058a commit d61b5f7

File tree

4 files changed

+5
-12
lines changed

4 files changed

+5
-12
lines changed

pytest.ini

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,9 @@
1414
filterwarnings =
1515
error::RuntimeWarning
1616
error::DeprecationWarning
17-
error:django.conf.urls.url\(\) is deprecated:django.utils.deprecation.RemovedInDjango40Warning
1817
ignore:defusedxml.lxml:DeprecationWarning:zeep
1918
ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3:DeprecationWarning:(graphene|singledispatch)
20-
ignore:The DEFAULT_HASHING_ALGORITHM transitional setting is deprecated:django.utils.deprecation.RemovedInDjango40Warning
2119
ignore:'(elasticsearch_django|pwa|social_django|wagtail).*' defines default_app_config:django.utils.deprecation.RemovedInDjango41Warning:django
22-
# Tracking issues (where available):
23-
# - https://github.com/wagtail/wagtail/issues/6924
24-
# - https://github.com/flavors/django-graphql-jwt/issues/222
25-
ignore:The providing_args argument is deprecated.:django.utils.deprecation.RemovedInDjango40Warning:(wagtail|elasticsearch_django)
26-
# - https://github.com/silviolleite/django-pwa/issues/68
27-
ignore:django.conf.urls.url\(\) is deprecated:django.utils.deprecation.RemovedInDjango40Warning:(pwa|social_django)
2820
# https://github.com/ktosiek/pytest-freezegun/issues/35
2921
ignore:distutils Version classes are deprecated:DeprecationWarning:pytest_freezegun
3022

@@ -46,4 +38,4 @@ python_files = test_*.py
4638
# --capture=fd -> Capture all output written to the STDOUT and STDERR file descriptors.
4739
# https://docs.pytest.org/en/stable/capture.html
4840
#
49-
addopts = --tb=short --verbose --nomigrations --reuse-db --color=auto --capture=fd
41+
addopts = --tb=short --verbose --nomigrations --reuse-db --color=auto --capture=fd

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
zip_safe=False,
3333
install_requires=[
3434
"pytz",
35-
"django>=3.2,<4.0",
35+
"django>=3.2,<5.0",
3636
"structlog>=20.2.0",
3737
"python-dateutil>=2.8.2",
3838
],

tests/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
SECRET_KEY = "x"
22
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3"}}
33
INSTALLED_APPS = ["xocto", "django.contrib.auth", "django.contrib.contenttypes"]
4+
USE_DEPRECATED_PYTZ = True
45
USE_TZ = True
56
TIME_ZONE = "Europe/London"

tests/test_localtime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,10 @@ def test_conversion_of_bst_dt(self):
326326

327327
def test_converts_utc_to_europe_london(self):
328328
utc_dt = factories.utc.dt("2018-05-28T23:30")
329-
assert utc_dt.tzinfo.zone == "UTC"
329+
assert str(utc_dt.tzinfo) == "UTC"
330330

331331
local_dt = localtime.as_localtime(utc_dt)
332-
assert local_dt.tzinfo.zone == "Europe/London"
332+
assert str(local_dt.tzinfo) == "Europe/London"
333333

334334

335335
class TestIsUTC:

0 commit comments

Comments
 (0)