def test_get_revalidation_threshold(database):
    """ Tests the get_revalidation_threshold function to make sure it returns the correct, properly formatted date """
    sess = database.session

    # Revalidation date
    reval = RevalidationThresholdFactory(revalidation_date=datetime.date(2018, 1, 15))

    sess.add(reval)
    sess.commit()

    results = get_revalidation_threshold()
    assert results['revalidation_threshold'] == '01/15/2018'
def test_get_revalidation_threshold(database):
    """ Tests the get_revalidation_threshold function to make sure it returns the correct, properly formatted date """
    sess = database.session

    # Revalidation date
    reval = RevalidationThresholdFactory(revalidation_date=datetime.datetime(2018, 1, 15, 0, 0))

    sess.add(reval)
    sess.commit()

    results = get_revalidation_threshold()
    assert results['revalidation_threshold'] == '2018-01-15T00:00:00'
Beispiel #3
0
 def revalidation_threshold():
     return JsonResponse.create(StatusCode.OK, get_revalidation_threshold())
 def revalidation_threshold():
     return JsonResponse.create(StatusCode.OK, get_revalidation_threshold())
def test_get_revalidation_threshold_no_threshold():
    """ Tests the get_revalidation_threshold function to make sure it returns an empty string if there's no date """
    results = get_revalidation_threshold()
    assert results['revalidation_threshold'] == ''
def test_get_revalidation_threshold_no_threshold():
    """ Tests the get_revalidation_threshold function to make sure it returns an empty string if there's no date """
    results = get_revalidation_threshold()
    assert results['revalidation_threshold'] == ''