39
39
UuidRepresentation ,
40
40
)
41
41
from bson .code import Code
42
- from bson .datetime_ms import _max_datetime_ms
42
+ from bson .datetime_ms import _MAX_DATETIME_MS
43
43
from bson .dbref import DBRef
44
44
from bson .decimal128 import Decimal128
45
45
from bson .int64 import Int64
@@ -257,7 +257,7 @@ def test_datetime(self):
257
257
def test_datetime_ms (self ):
258
258
# Test ISO8601 in-range
259
259
dat_min : dict [str , Any ] = {"x" : DatetimeMS (0 )}
260
- dat_max : dict [str , Any ] = {"x" : DatetimeMS (_max_datetime_ms () )}
260
+ dat_max : dict [str , Any ] = {"x" : DatetimeMS (_MAX_DATETIME_MS )}
261
261
opts = JSONOptions (datetime_representation = DatetimeRepresentation .ISO8601 )
262
262
263
263
self .assertEqual (
@@ -271,7 +271,7 @@ def test_datetime_ms(self):
271
271
272
272
# Test ISO8601 out-of-range
273
273
dat_min = {"x" : DatetimeMS (- 1 )}
274
- dat_max = {"x" : DatetimeMS (_max_datetime_ms () + 1 )}
274
+ dat_max = {"x" : DatetimeMS (_MAX_DATETIME_MS + 1 )}
275
275
276
276
self .assertEqual ('{"x": {"$date": {"$numberLong": "-1"}}}' , json_util .dumps (dat_min ))
277
277
self .assertEqual (
@@ -302,7 +302,7 @@ def test_datetime_ms(self):
302
302
303
303
# Test decode from datetime.datetime to DatetimeMS
304
304
dat_min = {"x" : datetime .datetime .min }
305
- dat_max = {"x" : DatetimeMS (_max_datetime_ms () ).as_datetime (CodecOptions (tz_aware = False ))}
305
+ dat_max = {"x" : DatetimeMS (_MAX_DATETIME_MS ).as_datetime (CodecOptions (tz_aware = False ))}
306
306
opts = JSONOptions (
307
307
datetime_representation = DatetimeRepresentation .ISO8601 ,
308
308
datetime_conversion = DatetimeConversion .DATETIME_MS ,
0 commit comments