[SIP-15] Adding grace period (#8490)

This commit is contained in:
John Bodley
2019-11-04 12:00:41 -08:00
committed by GitHub
parent 338a2b1a51
commit 5dba2f4b56
4 changed files with 55 additions and 4 deletions

View File

@@ -920,3 +920,18 @@ class UtilsTestCase(unittest.TestCase):
)
self.assertIsNone(get_time_range_endpoints(form_data={}, slc=slc))
with app.app_context():
app.config["SIP_15_GRACE_PERIOD_END"] = date.today() + timedelta(days=1)
self.assertEqual(
get_time_range_endpoints(form_data={"datasource": "1__table"}, slc=slc),
(TimeRangeEndpoint.INCLUSIVE, TimeRangeEndpoint.INCLUSIVE),
)
app.config["SIP_15_GRACE_PERIOD_END"] = date.today()
self.assertEqual(
get_time_range_endpoints(form_data={"datasource": "1__table"}, slc=slc),
(TimeRangeEndpoint.INCLUSIVE, TimeRangeEndpoint.EXCLUSIVE),
)