          response = SimpleTemplateResponse('first/test.html', {
              'value': 123,
              'fn': datetime.now,
          })
          self.assertRaises(ContentNotRenderedError,
                            pickle.dumps, response)
  
          response.render()
          pickled_response = pickle.dumps(response)
          unpickled_response = pickle.loads(pickled_response)
          pickle.dumps(unpickled_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(StopIteration, next, generator)
 </s> add         with self.assertRaises(StopIteration):
            next(generator) </s> remove         self.assertRaises(ContentNotRenderedError, lambda: response.content)
 </s> add         with self.assertRaises(ContentNotRenderedError):
            response.content
        with self.assertRaises(ContentNotRenderedError):
            pickle.dumps(response)
          response = SimpleTemplateResponse('first/test.html', {
              'value': 123,
              'fn': datetime.now,
          })
        with self.assertRaises(ContentNotRenderedError):
            pickle.dumps(response)
        with self.assertRaises(ContentNotRenderedError):
            pickle.dumps(response)
  
          response.render()
          pickled_response = pickle.dumps(response)
          unpickled_response = pickle.loads(pickled_response)
          pickle.dumps(unpickled_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