MCPcopy
hub / github.com/django/django / test_not_allowed

Method test_not_allowed

tests/httpwrappers/tests.py:676–683  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

674 self.assertEqual(repr(response), "<HttpResponseNotModified status_code=304>")
675
676 def test_not_allowed(self):
677 response = HttpResponseNotAllowed(["GET"])
678 self.assertEqual(response.status_code, 405)
679 # Standard HttpResponse init args can be used
680 response = HttpResponseNotAllowed(
681 ["GET"], content="Only the GET method is allowed"
682 )
683 self.assertContains(response, "Only the GET method is allowed", status_code=405)
684
685 def test_not_allowed_repr(self):
686 response = HttpResponseNotAllowed(["GET", "OPTIONS"], content_type="text/plain")

Callers

nothing calls this directly

Calls 2

assertContainsMethod · 0.80

Tested by

no test coverage detected