summaryrefslogtreecommitdiff
path: root/tests/generic_views/test_base.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/generic_views/test_base.py')
-rw-r--r--tests/generic_views/test_base.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/generic_views/test_base.py b/tests/generic_views/test_base.py
index 7aaea3ffa0..f4b8a487ff 100644
--- a/tests/generic_views/test_base.py
+++ b/tests/generic_views/test_base.py
@@ -195,7 +195,7 @@ class ViewTest(SimpleTestCase):
view = SimpleView.as_view()
response = view(request)
self.assertEqual(200, response.status_code)
- self.assertTrue(response['Allow'])
+ self.assertTrue(response.headers['Allow'])
def test_options_for_get_view(self):
"""
@@ -226,7 +226,7 @@ class ViewTest(SimpleTestCase):
def _assert_allows(self, response, *expected_methods):
"Assert allowed HTTP methods reported in the Allow response header"
- response_allows = set(response['Allow'].split(', '))
+ response_allows = set(response.headers['Allow'].split(', '))
self.assertEqual(set(expected_methods + ('OPTIONS',)), response_allows)
def test_args_kwargs_request_on_self(self):
@@ -390,7 +390,7 @@ class TemplateViewTest(SimpleTestCase):
def test_content_type(self):
response = self.client.get('/template/content_type/')
- self.assertEqual(response['Content-Type'], 'text/plain')
+ self.assertEqual(response.headers['Content-Type'], 'text/plain')
def test_resolve_view(self):
match = resolve('/template/content_type/')
@@ -461,12 +461,12 @@ class RedirectViewTest(SimpleTestCase):
"Named pattern parameter should reverse to the matching pattern"
response = RedirectView.as_view(pattern_name='artist_detail')(self.rf.get('/foo/'), pk=1)
self.assertEqual(response.status_code, 302)
- self.assertEqual(response['Location'], '/detail/artist/1/')
+ self.assertEqual(response.headers['Location'], '/detail/artist/1/')
def test_named_url_pattern_using_args(self):
response = RedirectView.as_view(pattern_name='artist_detail')(self.rf.get('/foo/'), 1)
self.assertEqual(response.status_code, 302)
- self.assertEqual(response['Location'], '/detail/artist/1/')
+ self.assertEqual(response.headers['Location'], '/detail/artist/1/')
def test_redirect_POST(self):
"Default is a temporary redirect"