Skip to content

Commit c95ff03

Browse files
committed
fix deprecation warning about datetime.fromutctimestamp()
1 parent bc35e7f commit c95ff03

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

graphene/tests/issues/test_1293.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# https://github.com/graphql-python/graphene/issues/1293
22

3-
import datetime
3+
from datetime import datetime, timezone
44

55
import graphene
66
from graphql.utilities import print_schema
@@ -9,11 +9,11 @@
99
class Filters(graphene.InputObjectType):
1010
datetime_after = graphene.DateTime(
1111
required=False,
12-
default_value=datetime.datetime.utcfromtimestamp(1434549820776 / 1000),
12+
default_value=datetime.fromtimestamp(1434549820.776, timezone.utc),
1313
)
1414
datetime_before = graphene.DateTime(
1515
required=False,
16-
default_value=datetime.datetime.utcfromtimestamp(1444549820776 / 1000),
16+
default_value=datetime.fromtimestamp(1444549820.776, timezone.utc),
1717
)
1818

1919

0 commit comments

Comments
 (0)