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
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
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
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