diff --git a/tests/test_fields.py b/tests/test_fields.py index 8b449887..f58afb7a 100644 --- a/tests/test_fields.py +++ b/tests/test_fields.py @@ -1,5 +1,5 @@ from collections import OrderedDict -from datetime import date, datetime +from datetime import date, datetime, timedelta, timezone from decimal import Decimal from functools import partial @@ -10,6 +10,9 @@ from flask_restx import fields, Api +_CET_TIMEZONE = timezone(timedelta(hours=1), "CET") + + class FieldTestCase(object): field_class = None @@ -542,7 +545,7 @@ def test_max_exclusive(self): "Sat, 01 Jan 2011 23:59:59 -0000", ), ( - datetime(2011, 1, 1, 23, 59, 59, tzinfo=pytz.timezone("CET")), + datetime(2011, 1, 1, 23, 59, 59, tzinfo=_CET_TIMEZONE), "Sat, 01 Jan 2011 22:59:59 -0000", ), ], @@ -566,7 +569,7 @@ def test_rfc822_value(self, value, expected): "2011-01-01T23:59:59.001000+00:00", ), ( - datetime(2011, 1, 1, 23, 59, 59, tzinfo=pytz.timezone("CET")), + datetime(2011, 1, 1, 23, 59, 59, tzinfo=_CET_TIMEZONE), "2011-01-01T23:59:59+01:00", ), ], @@ -676,7 +679,7 @@ def test_max_exclusive(self): (datetime(2011, 1, 1, 23, 59, 59, tzinfo=pytz.utc), "2011-01-01"), (datetime(2011, 1, 1, 23, 59, 59, 1000, tzinfo=pytz.utc), "2011-01-01"), ( - datetime(2011, 1, 1, 23, 59, 59, tzinfo=pytz.timezone("CET")), + datetime(2011, 1, 1, 23, 59, 59, tzinfo=_CET_TIMEZONE), "2011-01-01", ), ],