1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #12747 -- Made reason phrases customizable.

This commit is contained in:
Aymeric Augustin
2013-05-19 12:58:13 +02:00
parent 3129d19071
commit cb86f707a0
7 changed files with 109 additions and 72 deletions

15
tests/responses/tests.py Normal file
View File

@@ -0,0 +1,15 @@
from django.http import HttpResponse
import unittest
class HttpResponseTests(unittest.TestCase):
def test_status_code(self):
resp = HttpResponse(status=418)
self.assertEqual(resp.status_code, 418)
self.assertEqual(resp.reason_phrase, "I'M A TEAPOT")
def test_reason_phrase(self):
reason = "I'm an anarchist coffee pot on crack."
resp = HttpResponse(status=814, reason=reason)
self.assertEqual(resp.status_code, 814)
self.assertEqual(resp.reason_phrase, reason)