You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
581 B

  1. from hc.api.models import Check
  2. from hc.test import BaseTestCase
  3. class PauseTestCase(BaseTestCase):
  4. def setUp(self):
  5. super(PauseTestCase, self).setUp()
  6. self.check = Check(user=self.alice, status="up")
  7. self.check.save()
  8. def test_it_pauses(self):
  9. url = "/checks/%s/pause/" % self.check.code
  10. self.client.login(username="[email protected]", password="password")
  11. r = self.client.post(url)
  12. self.assertRedirects(r, "/checks/")
  13. self.check.refresh_from_db()
  14. self.assertEqual(self.check.status, "paused")