Browse Source

test_update_timeout: test if a Flip object gets created

pull/211/head
Pēteris Caune 6 years ago
parent
commit
a8c102f799
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      hc/front/tests/test_update_timeout.py

+ 6
- 1
hc/front/tests/test_update_timeout.py View File

@ -1,7 +1,7 @@
from datetime import timedelta as td from datetime import timedelta as td
from django.utils import timezone from django.utils import timezone
from hc.api.models import Check
from hc.api.models import Flip, Check
from hc.test import BaseTestCase from hc.test import BaseTestCase
@ -45,6 +45,11 @@ class UpdateTimeoutTestCase(BaseTestCase):
self.check.refresh_from_db() self.check.refresh_from_db()
self.assertEqual(self.check.status, "up") self.assertEqual(self.check.status, "up")
flip = Flip.objects.get()
self.assertEqual(flip.owner_id, self.check.id)
self.assertEqual(flip.old_status, "down")
self.assertEqual(flip.new_status, "up")
def test_it_saves_cron_expression(self): def test_it_saves_cron_expression(self):
url = "/checks/%s/timeout/" % self.check.code url = "/checks/%s/timeout/" % self.check.code
payload = { payload = {


Loading…
Cancel
Save