예제 #1
0
def test_show_warning_last_seen_greater_than_threshold(freezer):
    last_seen = minutes_ago(timezone.now(), 6)
    assert show_warning(last_seen, timedelta(minutes=5)) is True
예제 #2
0
def test_show_warning_last_seen_less_than_threhold(freezer):
    last_seen = minutes_ago(timezone.now(), 2)
    assert show_warning(last_seen, timedelta(minutes=3)) is False
예제 #3
0
def test_show_warning_last_seen_equal_threhold(freezer):
    last_seen = minutes_ago(timezone.now(), 3)
    assert show_warning(last_seen, timedelta(minutes=3)) is True
예제 #4
0
def test_show_warning_last_seen_is_none():
    assert show_warning(None, timedelta()) is False
def test_show_warning_success(freezer):
    last_seen = timezone.now() - timedelta(minutes=6)
    assert show_warning(last_seen) is True
def test_show_warning_last_seen_less_than_threhold(freezer):
    last_seen = timezone.now() - timedelta(minutes=2)
    assert show_warning(last_seen, minutes=3) is False
def test_show_warning_last_seen_is_none():
    assert show_warning(None) is False