use utc timezone when creating datetime object
MODIFY
tests/test_collection_metadata.py
tests/test_collection_metadata.py
#!/usr/bin/env python3 -m pytest
import pytest
-from datetime import datetime
+from datetime import datetime, timezone
from plex_trakt_sync.plex_api import PlexLibraryItem
from tests.conftest import make
testdata = [
(
make(
- addedAt=datetime(1999, 1, 1),
+ addedAt=datetime(1999, 1, 1, tzinfo=timezone.utc),
media=[
make(
width=1280,
],
),
{
- 'collected_at': '1998-12-31:T22:00:00.000Z',
+ 'collected_at': '1999-01-01:T00:00:00.000Z',
'media_type': 'digital',
'resolution': 'hd_720p',
'audio_channels': '2.0',
),
(
make(
- addedAt=datetime(1999, 1, 1),
+ addedAt=datetime(1999, 1, 1, tzinfo=timezone.utc),
media=[
make(
width=1280,
],
),
{
- 'collected_at': '1998-12-31:T22:00:00.000Z',
+ 'collected_at': '1999-01-01:T00:00:00.000Z',
'media_type': 'digital',
'resolution': 'hd_720p',
'audio_channels': '2.0',

use utc timezone when creating datetime object