                  'value': 123,
                  'fn': datetime.now,
              }
          )
          self.assertRaises(ContentNotRenderedError,
                            pickle.dumps, response)
  
          # But if we render the response, we can pickle it.
          response.render()
          pickled_response = pickle.dumps(response)
          unpickled_response = pickle.loads(pickled_response)
 
</s> remove         self.assertRaises(ContentNotRenderedError,
                          pickle.dumps, response)
 </s> add         with self.assertRaises(ContentNotRenderedError):
            pickle.dumps(response) </s> remove         self.assertRaises(ContentNotRenderedError,
                          pickle.dumps, response)
 </s> add         with self.assertRaises(ContentNotRenderedError):
            pickle.dumps(response) </s> remove         self.assertRaises(ContentNotRenderedError,
                          pickle.dumps, response)
 </s> add         with self.assertRaises(ContentNotRenderedError):
            pickle.dumps(response) </s> remove         self.assertRaises(Http404, get_object_or_404, Article, title="Foo")
 </s> add         with self.assertRaises(Http404):
            get_object_or_404(Article, title="Foo") </s> remove         self.assertRaises(
            Restaurant.DoesNotExist, lambda: p.restaurant
        )
 </s> add         with self.assertRaises(Restaurant.DoesNotExist):
            p.restaurant
        with self.assertRaises(ContentNotRenderedError):
            pickle.dumps(response)
                  'value': 123,
                  'fn': datetime.now,
              }
          )
        with self.assertRaises(ContentNotRenderedError):
            pickle.dumps(response)
        with self.assertRaises(ContentNotRenderedError):
            pickle.dumps(response)
  
          # But if we render the response, we can pickle it.
          response.render()
          pickled_response = pickle.dumps(response)
          unpickled_response = pickle.loads(pickled_response)
keep keep keep keep replace replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/template_tests/test_response.py