              'mailto:test@example.com',
              'file:///etc/passwd',
          ]
          for url in bad_urls:
              self.assertRaises(SuspiciousOperation,
                                HttpResponseRedirect, url)
              self.assertRaises(SuspiciousOperation,
                                HttpResponsePermanentRedirect, url)
  
  
  class HttpResponseSubclassesTests(SimpleTestCase):
      def test_redirect(self):
          response = HttpResponseRedirect('/redirected/')
 
</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(StopIteration, next, generator)
 </s> add         with self.assertRaises(StopIteration):
            next(generator) </s> remove         self.assertRaises(FieldError, modelform_factory,
                          Person, fields=['no-field', 'name'])
 </s> add         with self.assertRaises(FieldError):
            modelform_factory(Person, fields=['no-field', 'name']) </s> remove         self.assertRaises(ContentNotRenderedError, iteration)
 </s> add         with self.assertRaises(ContentNotRenderedError):
            iteration() </s> remove         self.assertRaises(ContentNotRenderedError, lambda: response.content)
 </s> add         with self.assertRaises(ContentNotRenderedError):
            response.content
            with self.assertRaises(SuspiciousOperation):
                HttpResponseRedirect(url)
            with self.assertRaises(SuspiciousOperation):
                HttpResponsePermanentRedirect(url)
              'mailto:test@example.com',
              'file:///etc/passwd',
          ]
          for url in bad_urls:
            with self.assertRaises(SuspiciousOperation):
                HttpResponseRedirect(url)
            with self.assertRaises(SuspiciousOperation):
                HttpResponsePermanentRedirect(url)
            with self.assertRaises(SuspiciousOperation):
                HttpResponseRedirect(url)
            with self.assertRaises(SuspiciousOperation):
                HttpResponsePermanentRedirect(url)
            with self.assertRaises(SuspiciousOperation):
                HttpResponseRedirect(url)
            with self.assertRaises(SuspiciousOperation):
                HttpResponsePermanentRedirect(url)
            with self.assertRaises(SuspiciousOperation):
                HttpResponseRedirect(url)
            with self.assertRaises(SuspiciousOperation):
                HttpResponsePermanentRedirect(url)
  
  
  class HttpResponseSubclassesTests(SimpleTestCase):
      def test_redirect(self):
          response = HttpResponseRedirect('/redirected/')
keep keep keep keep replace replace replace replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/httpwrappers/tests.py