  
          # Check the case view argument is ok if predefined on the class...
          CustomizableView.as_view(parameter="value")
          # ...but raises errors otherwise.
          self.assertRaises(TypeError, CustomizableView.as_view, foobar="value")
  
      def test_calling_more_than_once(self):
          """
          Test a view can only be called once.
          """
 
</s> remove             self.assertRaises(TypeError, SimpleView.as_view, **kwargs)
 </s> add             with self.assertRaises(TypeError):
                SimpleView.as_view(**kwargs) </s> remove         self.assertRaises(SuspiciousOperation, self.storage.exists, '..')
        self.assertRaises(SuspiciousOperation, self.storage.exists, '/etc/passwd')
 </s> add         with self.assertRaises(SuspiciousOperation):
            self.storage.exists('..')
        with self.assertRaises(SuspiciousOperation):
            self.storage.exists('/etc/passwd') </s> remove         self.assertRaises(ImproperlyConfigured,
                          self.client.get,
                          '/syndication/articles/')
 </s> add         with self.assertRaises(ImproperlyConfigured):
            self.client.get('/syndication/articles/') </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.client.get, '/template/no_template/')
 </s> add         with self.assertRaises(ImproperlyConfigured):
            self.client.get('/template/no_template/')
        with self.assertRaises(TypeError):
            CustomizableView.as_view(foobar="value")
  
          # Check the case view argument is ok if predefined on the class...
          CustomizableView.as_view(parameter="value")
          # ...but raises errors otherwise.
        with self.assertRaises(TypeError):
            CustomizableView.as_view(foobar="value")
  
      def test_calling_more_than_once(self):
          """
          Test a view can only be called once.
          """
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/generic_views/test_base.py