forked from GithubBackups/healthchecks
Another quick test
This commit is contained in:
parent
53a20ffba2
commit
2131c6512b
@ -1,3 +0,0 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
0
hc/api/tests/__init__.py
Normal file
0
hc/api/tests/__init__.py
Normal file
20
hc/api/tests/test_ping.py
Normal file
20
hc/api/tests/test_ping.py
Normal file
@ -0,0 +1,20 @@
|
||||
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"
|
Loading…
x
Reference in New Issue
Block a user