diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2015-01-12 14:45:09 -0800 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-03-12 20:18:06 -0400 |
commit | d861f95c445652e4269c9015836d14dcf8b9a587 (patch) | |
tree | 58542fc7c9525df3459468c912f685c04017749f /tests/responses | |
parent | 7f8588d22ea3b53ba55d05922b67e7b3a0a7c91c (diff) | |
download | django-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.py | 6 |
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) |