Skip to content

Commit 1593499

Browse files
committed
Add Django 5.0 to test matrix (fixes #704)
- timezone information is now on by default, and serilizers are expecting zulu time. - Replace manual timestamp truncation with datetime timespec set to milliseconds
1 parent 3a8a299 commit 1593499

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.github/workflows/python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
strategy:
88
matrix:
9-
python-version: [3.8, 3.9, "3.10", "3.11"]
9+
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
1010

1111
steps:
1212
- uses: actions/checkout@v2.3.4

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
@nox.session()
5-
@nox.parametrize("django", ["4.1", "4.2"])
5+
@nox.parametrize("django", ["4.1", "4.2", "5.0"])
66
def tests(session, django):
77
session.install("poetry")
88
session.run("poetry", "install", "-E", "minify")

tests/serializer/test_dumps.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def test_complicated_model():
162162

163163
expected = {
164164
"date": str(model.date),
165-
"datetime": model.datetime.isoformat()[:-3],
165+
"datetime": model.datetime.isoformat(timespec="milliseconds").replace("+00:00", "Z"),
166166
"decimal_value": "0.984",
167167
"duration": "-1 19:00:00",
168168
"float_value": "0.583",
@@ -195,7 +195,7 @@ def test_subclass_complicated_model():
195195
"subclass_name": "def",
196196
"pk": 2,
197197
"name": "abc",
198-
"datetime": model.datetime.isoformat()[:-3],
198+
"datetime": model.datetime.isoformat(timespec="milliseconds").replace("+00:00", "Z"),
199199
"float_value": "0.583",
200200
"decimal_value": "0.984",
201201
"uuid": str(model.uuid),
@@ -231,7 +231,7 @@ def test_model_with_timedelta(db): # noqa: ARG001
231231
"decimal_value": None,
232232
"uuid": str(flavor.uuid),
233233
"date": str(now_dt.date()),
234-
"datetime": now_dt.isoformat()[:-3],
234+
"datetime": now_dt.isoformat(timespec="milliseconds").replace("+00:00", "Z"),
235235
"time": str(now_dt.time())[:-3],
236236
"duration": "-1 19:00:00",
237237
"pk": 8,

0 commit comments

Comments
 (0)