Browse Source

Test for HEAD method, note about IPv6

pull/7/head
Pēteris Caune 9 years ago
parent
commit
d81555687e
2 changed files with 11 additions and 1 deletions
  1. +9
    -0
      hc/api/tests/test_ping.py
  2. +2
    -1
      templates/front/docs.html

+ 9
- 0
hc/api/tests/test_ping.py View File

@ -26,6 +26,15 @@ class PingTestCase(TestCase):
r = csrf_client.post("/ping/%s/" % check.code)
assert r.status_code == 200
def test_head_works(self):
check = Check()
check.save()
csrf_client = Client(enforce_csrf_checks=True)
r = csrf_client.head("/ping/%s/" % check.code)
assert r.status_code == 200
assert Ping.objects.count() == 1
def test_it_handles_bad_uuid(self):
r = self.client.get("/ping/not-uuid/")
assert r.status_code == 400


+ 2
- 1
templates/front/docs.html View File

@ -23,7 +23,8 @@ It is all very simple, really.</p>
</p>
<ul>
<li>HTTP and HTTPS protocols both are fine</li>
<li>Request method can be GET or POST</li>
<li>Request method can be GET, POST or HEAD</li>
<li>Both IPv4 and IPv6 work</li>
<li>It does not matter what request headers you send</li>
<li>You can leave request body empty or put anything in it, it's all good</li>
</ul>


Loading…
Cancel
Save