summaryrefslogtreecommitdiffstats
path: root/tests/core/test_ld.py
blob: bb465e1ee089ff04acbddfe1d6be0f70531c1f2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import datetime

from core.ld import parse_ld_date


def test_parse_ld_date():
    """
    Tests that the various kinds of LD dates that we see will work
    """
    assert parse_ld_date("2022-11-16T15:57:58Z") == datetime.datetime(
        2022,
        11,
        16,
        15,
        57,
        58,
        tzinfo=datetime.timezone.utc,
    )

    assert parse_ld_date("2022-11-16T15:57:58.123Z") == datetime.datetime(
        2022,
        11,
        16,
        15,
        57,
        58,
        tzinfo=datetime.timezone.utc,
    )