adjusting the tests to reflect on the new full year convert limit!
This commit is contained in:
parent
a9724e7383
commit
c47fa0f9a2
|
@ -6,12 +6,12 @@ from freezegun import freeze_time
|
||||||
def test_convert_validity_years(session):
|
def test_convert_validity_years(session):
|
||||||
from lemur.common.missing import convert_validity_years
|
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))
|
data = convert_validity_years(dict(validity_years=2))
|
||||||
|
|
||||||
assert data['validity_start'] == arrow.utcnow().isoformat()
|
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))
|
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()
|
||||||
|
|
Loading…
Reference in New Issue