@@ -468,19 +468,22 @@ def test_traits_datetime():
468
468
assert testdate .minute == 33
469
469
assert testdate .second == 6
470
470
assert testdate .microsecond == 654321
471
+ assert testdate .tzinfo == timezone .utc
471
472
472
473
# parsing without miliseconds
473
474
testdate = typ .traits .from_literal ("datetime'1976-11-23T03:33:06'" )
474
475
assert testdate .year == 1976
475
476
assert testdate .second == 6
476
477
assert testdate .microsecond == 0
478
+ assert testdate .tzinfo == timezone .utc
477
479
478
480
# parsing without seconds and miliseconds
479
481
testdate = typ .traits .from_literal ("datetime'1976-11-23T03:33'" )
480
482
assert testdate .year == 1976
481
483
assert testdate .minute == 33
482
484
assert testdate .second == 0
483
485
assert testdate .microsecond == 0
486
+ assert testdate .tzinfo == timezone .utc
484
487
485
488
# parsing invalid value
486
489
with pytest .raises (PyODataModelError ) as e_info :
@@ -502,19 +505,22 @@ def test_traits_datetime():
502
505
assert testdate .minute == 33
503
506
assert testdate .second == 6
504
507
assert testdate .microsecond == 10000
508
+ assert testdate .tzinfo == timezone .utc
505
509
506
510
# parsing without miliseconds
507
511
testdate = typ .traits .from_json ("/Date(217567986000)/" )
508
512
assert testdate .year == 1976
509
513
assert testdate .second == 6
510
514
assert testdate .microsecond == 0
515
+ assert testdate .tzinfo == timezone .utc
511
516
512
517
# parsing without seconds and miliseconds
513
518
testdate = typ .traits .from_json ("/Date(217567980000)/" )
514
519
assert testdate .year == 1976
515
520
assert testdate .minute == 33
516
521
assert testdate .second == 0
517
522
assert testdate .microsecond == 0
523
+ assert testdate .tzinfo == timezone .utc
518
524
519
525
# parsing the lowest value
520
526
with pytest .raises (OverflowError ):
@@ -528,6 +534,7 @@ def test_traits_datetime():
528
534
assert testdate .minute == 0
529
535
assert testdate .second == 0
530
536
assert testdate .microsecond == 0
537
+ assert testdate .tzinfo == timezone .utc
531
538
532
539
# parsing the highest value
533
540
with pytest .raises (OverflowError ):
@@ -541,6 +548,7 @@ def test_traits_datetime():
541
548
assert testdate .minute == 59
542
549
assert testdate .second == 59
543
550
assert testdate .microsecond == 999000
551
+ assert testdate .tzinfo == timezone .utc
544
552
545
553
# parsing invalid value
546
554
with pytest .raises (PyODataModelError ) as e_info :
0 commit comments