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
473 B

  1. from django.contrib.auth.models import User
  2. from django.test import TestCase
  3. from hc.api.models import Check
  4. class PingTestCase(TestCase):
  5. def test_it_works(self):
  6. user = User(username="jdoe")
  7. user.save()
  8. check = Check(user=user)
  9. check.save()
  10. r = self.client.get("/ping/%s/" % check.code)
  11. assert r.status_code == 200
  12. same_check = Check.objects.get(code=check.code)
  13. assert same_check.status == "up"