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

from django.contrib.auth.models import User
from django.test import TestCase
from hc.api.models import Check
class PingTestCase(TestCase):
def test_it_works(self):
user = User(username="jdoe")
user.save()
check = Check(user=user)
check.save()
r = self.client.get("/ping/%s/" % check.code)
assert r.status_code == 200
same_check = Check.objects.get(code=check.code)
assert same_check.status == "up"