  
      def test_newlines_in_headers(self):
          # Bug #10188: Do not allow newlines in headers (CR or LF)
          r = HttpResponse()
          self.assertRaises(BadHeaderError, r.__setitem__, 'test\rstr', 'test')
          self.assertRaises(BadHeaderError, r.__setitem__, 'test\nstr', 'test')
  
      def test_dict_behavior(self):
          """
          Test for bug #14020: Make HttpResponse.get work like dict.get
          """
 
</s> remove         self.assertRaises(ImproperlyConfigured, self.user.has_perm, ('perm', TestObj(),))
 </s> add         with self.assertRaises(ImproperlyConfigured):
            self.user.has_perm(('perm', TestObj())) </s> remove         self.assertRaises(TypeError, authenticate, username='test', password='test')
 </s> add         with self.assertRaises(TypeError):
            authenticate(username='test', password='test') </s> remove         self.assertRaises(TemplateDoesNotExist, self.client.get, '/render_no_template/')
 </s> add         with self.assertRaises(TemplateDoesNotExist):
            self.client.get('/render_no_template/') </s> remove         self.assertRaises(ImproperlyConfigured, self.backend)
 </s> add         with self.assertRaises(ImproperlyConfigured):
            self.backend() </s> remove         self.assertRaises(ImproperlyConfigured,
                          self.client.get,
                          '/syndication/articles/')
 </s> add         with self.assertRaises(ImproperlyConfigured):
            self.client.get('/syndication/articles/')
        with self.assertRaises(BadHeaderError):
            r.__setitem__('test\rstr', 'test')
        with self.assertRaises(BadHeaderError):
            r.__setitem__('test\nstr', 'test')
  
      def test_newlines_in_headers(self):
          # Bug #10188: Do not allow newlines in headers (CR or LF)
          r = HttpResponse()
        with self.assertRaises(BadHeaderError):
            r.__setitem__('test\rstr', 'test')
        with self.assertRaises(BadHeaderError):
            r.__setitem__('test\nstr', 'test')
        with self.assertRaises(BadHeaderError):
            r.__setitem__('test\rstr', 'test')
        with self.assertRaises(BadHeaderError):
            r.__setitem__('test\nstr', 'test')
  
      def test_dict_behavior(self):
          """
          Test for bug #14020: Make HttpResponse.get work like dict.get
          """
keep keep keep keep replace replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/httpwrappers/tests.py