lemur/lemur/tests/test_missing.py
kevgliss e6b291d034 Time (#482)
* adding python 3.5 as a target

* adding env flag

* Aligning on arrow dates.
2016-11-09 10:56:22 -08:00

18 lines
596 B
Python

import arrow
from freezegun import freeze_time
def test_convert_validity_years(session):
from lemur.common.missing import convert_validity_years
with freeze_time("2016-01-01"):
data = convert_validity_years(dict(validity_years=2))
assert data['validity_start'] == arrow.utcnow().isoformat()
assert data['validity_end'] == arrow.utcnow().replace(years=+2).isoformat()
with freeze_time("2015-01-10"):
data = convert_validity_years(dict(validity_years=1))
assert data['validity_end'] == arrow.utcnow().replace(years=+1, days=-2).isoformat()