summaryrefslogtreecommitdiff
path: root/tests/responses
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2015-01-12 14:45:09 -0800
committerTim Graham <timograham@gmail.com>2015-03-12 20:18:06 -0400
commitd861f95c445652e4269c9015836d14dcf8b9a587 (patch)
tree58542fc7c9525df3459468c912f685c04017749f /tests/responses
parent7f8588d22ea3b53ba55d05922b67e7b3a0a7c91c (diff)
downloaddjango-d861f95c445652e4269c9015836d14dcf8b9a587.tar.gz
Fixed #24139 -- Changed HttpResponse.reason_phrase to evaluate based on status_code.
Diffstat (limited to 'tests/responses')
-rw-r--r--tests/responses/tests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/responses/tests.py b/tests/responses/tests.py
index bf7a0e12ef..91ec710c72 100644
--- a/tests/responses/tests.py
+++ b/tests/responses/tests.py
@@ -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)