          res = redirect('places', 1)
          self.assertEqual(res.url, '/places/1/')
          res = redirect('headlines', year='2008', month='02', day='17')
          self.assertEqual(res.url, '/headlines/2008.02.17/')
          self.assertRaises(NoReverseMatch, redirect, 'not-a-view')
  
      def test_redirect_to_url(self):
          res = redirect('/foo/')
          self.assertEqual(res.url, '/foo/')
          res = redirect('http://example.com/')
 
</s> remove         self.assertRaises(NoReverseMatch, redirect, absolute_kwargs_view, wrong_argument=None)
 </s> add         with self.assertRaises(NoReverseMatch):
            redirect(absolute_kwargs_view, wrong_argument=None) </s> remove         self.assertRaises(ObjectDoesNotExist, self.client.get, '/detail/doesnotexist/1/')
 </s> add         with self.assertRaises(ObjectDoesNotExist):
            self.client.get('/detail/doesnotexist/1/') </s> remove         self.assertRaises(ImproperlyConfigured, self.client.get, '/detail/author/invalid/qs/')
 </s> add         with self.assertRaises(ImproperlyConfigured):
            self.client.get('/detail/author/invalid/qs/') </s> remove         self.assertRaises(ImproperlyConfigured, self.client.get, '/dates/books/invalid/')
 </s> add         with self.assertRaises(ImproperlyConfigured):
            self.client.get('/dates/books/invalid/') </s> remove                             self.assertRaises(ValueError, setfcn, ul, i, j, k, sliceLen - 1)
 </s> add                             with self.assertRaises(ValueError):
                                setfcn(ul, i, j, k, sliceLen - 1)
        with self.assertRaises(NoReverseMatch):
            redirect('not-a-view')
          res = redirect('places', 1)
          self.assertEqual(res.url, '/places/1/')
          res = redirect('headlines', year='2008', month='02', day='17')
          self.assertEqual(res.url, '/headlines/2008.02.17/')
        with self.assertRaises(NoReverseMatch):
            redirect('not-a-view')
  
      def test_redirect_to_url(self):
          res = redirect('/foo/')
          self.assertEqual(res.url, '/foo/')
          res = redirect('http://example.com/')
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/urlpatterns_reverse/tests.py