mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #24139 -- Changed HttpResponse.reason_phrase to evaluate based on status_code.
This commit is contained in:
parent
7f8588d22e
commit
d861f95c44
4 changed files with 43 additions and 6 deletions
|
@ -54,6 +54,12 @@ class HttpResponseTests(SimpleTestCase):
|
|||
self.assertEqual(resp.status_code, 503)
|
||||
self.assertEqual(resp.reason_phrase, "Service Unavailable")
|
||||
|
||||
def test_change_status_code(self):
|
||||
resp = HttpResponse()
|
||||
resp.status_code = 503
|
||||
self.assertEqual(resp.status_code, 503)
|
||||
self.assertEqual(resp.reason_phrase, "Service Unavailable")
|
||||
|
||||
def test_reason_phrase(self):
|
||||
reason = "I'm an anarchist coffee pot on crack."
|
||||
resp = HttpResponse(status=814, reason=reason)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue