Fix tests.

This commit is contained in:
Pēteris Caune 2016-12-13 21:37:29 +02:00
parent c8b1c482ea
commit 5a4c3ce8ea
2 changed files with 3 additions and 3 deletions

View File

@ -97,7 +97,7 @@ class Check(models.Model):
""" Return the datetime when grace period starts. """
# The common case, grace starts after timeout
if not self.schedule:
if self.kind == "simple":
return self.last_ping + self.timeout
# The complex case, next ping is expected based on cron schedule

View File

@ -43,7 +43,7 @@ class CheckModelTestCase(TestCase):
# Expect ping every midnight, default grace is 1 hour
check = Check()
check.timeout = timedelta(minutes=0)
check.kind = "cron"
check.schedule = "0 0 * * *"
check.status = "up"
check.last_ping = dt
@ -61,7 +61,7 @@ class CheckModelTestCase(TestCase):
# Expect ping every day at 10am, default grace is 1 hour
check = Check()
check.timeout = timedelta(minutes=0)
check.kind = "cron"
check.schedule = "0 10 * * *"
check.status = "up"
check.last_ping = dt