diff options
author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-05-19 12:58:13 +0200 |
---|---|---|
committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-05-19 13:14:54 +0200 |
commit | cb86f707a04e5635817d5f37a1443f9bf7d6af21 (patch) | |
tree | c44ae6e62aa569ba1769949b8d9f38b6fecc0bc9 /tests/responses | |
parent | 3129d190714216cd83d2494a88f537699a42375f (diff) | |
download | django-cb86f707a04e5635817d5f37a1443f9bf7d6af21.tar.gz |
Fixed #12747 -- Made reason phrases customizable.
Diffstat (limited to 'tests/responses')
-rw-r--r-- | tests/responses/__init__.py | 0 | ||||
-rw-r--r-- | tests/responses/models.py | 0 | ||||
-rw-r--r-- | tests/responses/tests.py | 15 |
3 files changed, 15 insertions, 0 deletions
diff --git a/tests/responses/__init__.py b/tests/responses/__init__.py new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/responses/__init__.py diff --git a/tests/responses/models.py b/tests/responses/models.py new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/responses/models.py diff --git a/tests/responses/tests.py b/tests/responses/tests.py new file mode 100644 index 0000000000..e5320f5af9 --- /dev/null +++ b/tests/responses/tests.py @@ -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) |