Test for HEAD method, note about IPv6

This commit is contained in:
Pēteris Caune 2015-08-18 10:52:22 +03:00
parent 655f51e1d2
commit d81555687e
2 changed files with 11 additions and 1 deletions

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

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>