forked from GithubBackups/healthchecks
Fix tests.
This commit is contained in:
parent
c8b1c482ea
commit
5a4c3ce8ea
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user