Browse Source

Another quick test

pull/7/head
Pēteris Caune 10 years ago
parent
commit
2131c6512b
3 changed files with 20 additions and 3 deletions
  1. +0
    -3
      hc/api/tests.py
  2. +0
    -0
      hc/api/tests/__init__.py
  3. +20
    -0
      hc/api/tests/test_ping.py

+ 0
- 3
hc/api/tests.py View File

@ -1,3 +0,0 @@
from django.test import TestCase
# Create your tests here.

+ 0
- 0
hc/api/tests/__init__.py View File


+ 20
- 0
hc/api/tests/test_ping.py View 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…
Cancel
Save