adjusting the tests to reflect on the new full year convert limit!

This commit is contained in:
Hossein Shafagh 2019-01-24 17:52:22 -08:00
parent a9724e7383
commit c47fa0f9a2
1 changed files with 4 additions and 4 deletions

View File

@ -6,12 +6,12 @@ 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"):
with freeze_time("2016-01-02"):
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()
assert data['validity_end'] == arrow.utcnow().replace(years=+2, days=-1).isoformat()
with freeze_time("2015-01-10"):
with freeze_time("2015-01-11"):
data = convert_validity_years(dict(validity_years=1))
assert data['validity_end'] == arrow.utcnow().replace(years=+1, days=-2).isoformat()
assert data['validity_end'] == arrow.utcnow().replace(years=+1, days=-3).isoformat()