From fe04429fad900cd33efe3e0f6481704036bc5892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Fri, 21 Dec 2018 13:17:00 +0200 Subject: [PATCH] Don't update last_ping_was_fail, it is not read anywhere anymore. --- hc/api/models.py | 1 - hc/api/tests/test_ping.py | 11 ----------- 2 files changed, 12 deletions(-) diff --git a/hc/api/models.py b/hc/api/models.py index 4929bb89..0c88ab00 100644 --- a/hc/api/models.py +++ b/hc/api/models.py @@ -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: diff --git a/hc/api/tests/test_ping.py b/hc/api/tests/test_ping.py index b9747a27..c98501fe 100644 --- a/hc/api/tests/test_ping.py +++ b/hc/api/tests/test_ping.py @@ -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)