Example #1
0
def test_ensure_iso_date_format_non_iso_string(html, expected):
    assert ensure_iso_date_format(html) == expected
Example #2
0
def test_ensure_iso_date_format_hh_colon_mmZ_format():
    datetime_string = '2019-02-18T17:52:10Z'
    expected_iso_string = '2019-02-18T17:52:10'
    assert ensure_iso_date_format(datetime_string) == expected_iso_string
Example #3
0
def test_ensure_iso_date_format_with_ms():
    datetime_string = '2019-05-14T16:45:01.493'
    expected_iso_string = '2019-05-14T16:45:01'
    assert ensure_iso_date_format(datetime_string) == expected_iso_string
Example #4
0
def test_ensure_iso_date_format_000Z_format():
    datetime_string = '2019-02-15T15:54:50.000Z'
    expected_iso_string = '2019-02-15T15:54:50'
    assert ensure_iso_date_format(datetime_string) == expected_iso_string
Example #5
0
def test_ensure_iso_date_format_no_tz():
    datetime_string = '2014-10-24T17:32:46'
    expected_iso_string = '2014-10-24T17:32:46'
    assert ensure_iso_date_format(datetime_string) == expected_iso_string
Example #6
0
def test_ensure_iso_date_format_no_seconds():
    datetime_string = '2014-10-24T17:32+12:00'
    expected_iso_string = '2014-10-24T17:32:00'
    assert ensure_iso_date_format(datetime_string) == expected_iso_string
Example #7
0
def test_ensure_iso_date_format_timezone_drop():
    datetime_string = '2014-10-24T17:32:46+12:00'
    expected_iso_string = '2014-10-24T17:32:46'
    assert ensure_iso_date_format(datetime_string) == expected_iso_string
Example #8
0
def test_ensure_iso_date_format_timezone_keep():
    datetime_string = '2014-10-24T17:32:46+12:00'
    expected_iso_string = '2014-10-24T17:32:46+12:00'
    assert ensure_iso_date_format(datetime_string,
                                  ignoretz=False) == expected_iso_string