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)
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")
def test_timestamp_property_valid(value): ts_prop = TimestampProperty() assert ts_prop.clean(value) == FAKE_TIME