Browse Source

Don't update last_ping_was_fail, it is not read anywhere anymore.

pull/211/head
Pēteris Caune 6 years ago
parent
commit
fe04429fad
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
2 changed files with 0 additions and 12 deletions
  1. +0
    -1
      hc/api/models.py
  2. +0
    -11
      hc/api/tests/test_ping.py

+ 0
- 1
hc/api/models.py View File

@ -227,7 +227,6 @@ class Check(models.Model):
else:
self.last_start = None
self.last_ping = timezone.now()
self.last_ping_was_fail = action == "fail"
new_status = "down" if action == "fail" else "up"
if self.status != new_status:


+ 0
- 11
hc/api/tests/test_ping.py View File

@ -128,22 +128,11 @@ class PingTestCase(TestCase):
self.check.refresh_from_db()
self.assertTrue(self.check.has_confirmation_link)
def test_ping_resets_fail_flag(self):
self.check.last_ping_was_fail = True
self.check.save()
r = self.client.get("/ping/%s/" % self.check.code)
self.assertEqual(r.status_code, 200)
self.check.refresh_from_db()
self.assertFalse(self.check.last_ping_was_fail)
def test_fail_endpoint_works(self):
r = self.client.get("/ping/%s/fail" % self.check.code)
self.assertEqual(r.status_code, 200)
self.check.refresh_from_db()
self.assertTrue(self.check.last_ping_was_fail)
self.assertEqual(self.check.status, "down")
self.assertEqual(self.check.alert_after, None)


Loading…
Cancel
Save