Beispiel #1
0
def test_timestamp_property_valid(value):
    ts_prop = TimestampProperty()
    assert ts_prop.clean(value) == dt.datetime(2017,
                                               1,
                                               1,
                                               12,
                                               34,
                                               56,
                                               tzinfo=pytz.utc)
Beispiel #2
0
def test_timestamp_property_invalid():
    ts_prop = TimestampProperty()
    with pytest.raises(ValueError):
        ts_prop.clean(1)
    with pytest.raises(ValueError):
        ts_prop.clean("someday sometime")
Beispiel #3
0
def test_timestamp_property_valid(value):
    ts_prop = TimestampProperty()
    assert ts_prop.clean(value) == FAKE_TIME