|
|
@ -27,3 +27,13 @@ class CheckModelTestCase(TestCase): |
|
|
|
|
|
|
|
self.assertTrue(check.in_grace_period()) |
|
|
|
self.assertEqual(check.get_status(), "up") |
|
|
|
|
|
|
|
def test_paused_check_is_not_in_grace_period(self): |
|
|
|
check = Check() |
|
|
|
|
|
|
|
check.status = "up" |
|
|
|
check.last_ping = timezone.now() - timedelta(days=1, minutes=30) |
|
|
|
self.assertTrue(check.in_grace_period()) |
|
|
|
|
|
|
|
check.status = "paused" |
|
|
|
self.assertFalse(check.in_grace_period()) |