diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/httpwrappers/tests.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/regressiontests/httpwrappers/tests.py b/tests/regressiontests/httpwrappers/tests.py index bbb2518b32..c84b2cd44e 100644 --- a/tests/regressiontests/httpwrappers/tests.py +++ b/tests/regressiontests/httpwrappers/tests.py @@ -6,7 +6,7 @@ import pickle from django.core.exceptions import SuspiciousOperation from django.http import (QueryDict, HttpResponse, HttpResponseRedirect, - HttpResponsePermanentRedirect, + HttpResponsePermanentRedirect, HttpResponseNotModified, SimpleCookie, BadHeaderError, parse_cookie) from django.utils import six @@ -330,6 +330,16 @@ class HttpResponseTests(unittest.TestCase): HttpResponsePermanentRedirect, url) +class HttpResponseSubclassesTests(unittest.TestCase): + def test_not_modified(self): + response = HttpResponseNotModified() + self.assertEqual(response.status_code, 304) + # 304 responses should not have content/content-type + with self.assertRaises(AttributeError): + response.content = "Hello dear" + self.assertNotIn('content-type', response) + + class CookieTests(unittest.TestCase): def test_encode(self): """ |
